-
Notifications
You must be signed in to change notification settings - Fork 7
Internal Shortcode | Post_Slug
EkoJr edited this page Jan 3, 2017
·
4 revisions
Adds the Post Slug (post_name). Alias to [post_name]
[post_slug]
(string) WP_Post->Post_Name.
File: advanced-post-list/includes/class/apl_shortcodes.php
/**
* Post Slug Shortcode
*
* Desc: Adds the Post Slug from WP_Post->post_name.
*
* 1. Add to return the Post Post_Name.
* 2. Return string.
*
* @since 0.4.0
*
* @param array $atts
* @return string Post->post_name.
*/
public function post_slug($atts)
{
//INIT
$atts_value = shortcode_atts( array() , $atts, 'post_slug');
$return_str = '';
//STEP 1
$return_str .= $this->_post->post_name;
//STEP 2
return $return_str;
}