コード例 #1
0
ファイル: filters-page-type.php プロジェクト: wp-papi/papi
/**
 * Get standard page name for the given post type.
 *
 * @param  string $post_type
 *
 * @return string
 */
function papi_filter_settings_standard_page_type_name($post_type)
{
    $name = papi_get_post_type_label($post_type, 'singular_name', 'Page');
    // New filter, with `type` in the filter tag.
    $tag = 'papi/settings/standard_page_type_name_' . $post_type;
    $out = apply_filters($tag, sprintf(__('Standard %s', 'papi'), $name));
    // Old filter, that didn't have `type` in the filter tag.
    // Should work until Papi 4.0.0.
    $tag = 'papi/settings/standard_page_name_' . $post_type;
    $out = apply_filters($tag, $out);
    return $out;
}
コード例 #2
0
ファイル: filters.php プロジェクト: KristoferN/papi
/**
 * Get standard page name for the given post type.
 *
 * @param  string $post_type
 *
 * @return string
 */
function papi_filter_settings_standard_page_name($post_type)
{
    $name = papi_get_post_type_label($post_type, 'singular_name', 'Page');
    return apply_filters('papi/settings/standard_page_name_' . $post_type, sprintf(__('Standard %s', 'papi'), $name));
}