Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress get page slug

// Get the queried object and sanitize it
$current_page = sanitize_post( $GLOBALS['wp_the_query']->get_queried_object() );
// Get the page slug
$slug = $current_page->post_name;
Comment

PREVIOUS NEXT
Code Example
Php :: php remove everything after a specific character 
Php :: what is forelse in laravel 
Php :: laravel get fillable attributes 
Php :: change font family in echo php 
Php :: wp-config.php repair 
Php :: convert stdclass object to array php 
Php :: drupal 8 get field entities 
Php :: wordpress throw to debug.log 
Php :: php server 
Php :: wp display custom fields 
Php :: php support block-level scope 
Php :: laravel add column to existing table 
Php :: push element at tart of arrray php 
Php :: serialize() php 
Php :: PHP Deprecated: Function create_function() 
Php :: Target class [FruitcakeCorsHandleCors] does not exist. 
Php :: laravel websockets onclose 
Php :: how unset request parameter in laravel 
Php :: php check if associative array is null 
Php :: drupal 8 date formater service 
Php :: time duration calculation laravel 
Php :: LaravelSocialiteTwoInvalidStateException 
Php :: factorial program in php using recursive function 
Php :: get raw query laravel 
Php :: php array remove value if exists 
Php :: how to save information on pdf file in laravel project 
Php :: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) 
Php :: route params link laravel 
Php :: get name custom post type wordpress 
Php :: how to update radio button value in database using php 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =