/** * Get custom permalink * * @since 1.0.5 */ public function get_custom_permalink() { if ($this->ID) { $custom_permalink = get_site_url() . '/' . sm_get_custom_slug() . '/' . $this->post_name . '/'; } else { return false; } return apply_filters('smartmockups_custom_permalink', $custom_permalink); }
/** * Retrieve mockup custom permalink by mockup ID * * @since 1.0.5 * @param int $mockup_id Mockup ID * @return string Mockup Custom Permalink */ function sm_get_mockup_custom_permalink($mockup_id = 0) { $post = get_post($mockup_id); if ($post && SMART_MOCKUPS_POSTTYPE == $post->post_type) { $custom_permalink = get_site_url() . '/' . sm_get_custom_slug() . '/' . $post->post_name . '/'; } else { return false; } return apply_filters('smartmockups_custom_permalink', $custom_permalink); }
<form method="post" action="options.php"> <?php $post_types = Smart_Mockups_Setup::post_types(); $settings = array('slug' => sm_get_custom_slug(), 'credits' => get_option('smartmockups_credits', 1)); settings_fields('smartmockups_settings_general'); ?> <table class="form-table"> <tbody> <tr valign="top"> <th scope="row" valign="top"> <label class="description" for="smartmockups_slug"><?php _e('Custom Slug'); ?> </label> </th> <td> <?php echo get_site_url(); ?> / <input id="smartmockups_slug" name="smartmockups_slug" type="text" class="regular-text" value="<?php esc_attr_e($settings['slug']); ?> " /> </td> </tr> <tr valign="top"> <th scope="row" valign="top"> <label class="credits" for="smartmockups_credits"><?php _e('Show Credits');