当前位置: 首页>>代码示例>>PHP>>正文


PHP add_post_type_support函数代码示例

本文整理汇总了PHP中add_post_type_support函数的典型用法代码示例。如果您正苦于以下问题:PHP add_post_type_support函数的具体用法?PHP add_post_type_support怎么用?PHP add_post_type_support使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了add_post_type_support函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: solofolio_theme_setup

function solofolio_theme_setup()
{
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('woocommerce');
    add_theme_support('title-tag');
    add_theme_support('html5', array('caption'));
    add_post_type_support('page', 'excerpt');
    // Disable image linking by default
    update_option('image_default_link_type', 'none');
    // Add additional image size for large displays, change defaults for others.
    add_image_size('xlarge', 1800, 1200, false);
    update_option('thumbnail_size_w', 10000);
    update_option('thumbnail_size_h', 200);
    update_option('medium_size_w', 600);
    update_option('medium_size_h', 400);
    update_option('large_size_w', 900);
    update_option('large_size_h', 600);
    # Disable thumbnail cropping
    if (false === get_option("thumbnail_crop")) {
        add_option("thumbnail_crop", "0");
    } else {
        update_option("thumbnail_crop", "0");
    }
}
开发者ID:ricardovv,项目名称:2015_maquinacondor,代码行数:25,代码来源:functions.php

示例2: custom_wordpress_setup

function custom_wordpress_setup()
{
    // Enable tags for Pages (@see: https://wordpress.org/support/topic/enable-tags-screen-for-pages#post-29500520
    //register_taxonomy_for_object_type('post_tag', 'page');
    // Enable excerpts for pages
    add_post_type_support('page', 'excerpt');
}
开发者ID:jrobson153,项目名称:style-guide,代码行数:7,代码来源:functions.php

示例3: __construct

 /**
  * Constructor.
  * @since  1.1.0
  */
 public function __construct()
 {
     add_filter('woo_conditions', array(&$this, 'register_conditions'));
     add_filter('woo_conditions_headings', array(&$this, 'register_conditions_headings'));
     add_filter('woo_conditions_reference', array(&$this, 'register_conditions_reference'));
     add_post_type_support('product', 'woosidebars');
 }
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:11,代码来源:integration-woocommerce.php

示例4: _action_fw_ext_page_builder_add_support

/**
 * Call add_post_type_support('{post-type}', 'fw-page-builder')
 * for post types checked on Page Builder Settings page.
 */
function _action_fw_ext_page_builder_add_support()
{
    $feature_name = fw_ext('page-builder')->get_supports_feature_name();
    foreach (array_keys(fw_get_db_ext_settings_option('page-builder', 'post_types')) as $slug) {
        add_post_type_support($slug, $feature_name);
    }
}
开发者ID:ExtPoint,项目名称:Unyson-PageBuilder-Extension,代码行数:11,代码来源:hooks.php

示例5: mighty_theme_setup

 function mighty_theme_setup()
 {
     /* Register WP3+ menus */
     register_nav_menu('header-menu', __('Header Menu', 'mighty'));
     register_nav_menu('footer-menu', __('Footer Menu', 'mighty'));
     /* Configure WP 2.9+ thumbnails */
     add_theme_support('post-thumbnails');
     add_image_size('s', 300, 300, true);
     add_image_size('m', 640, '', true);
     add_image_size('l', 980, '', true);
     update_option('thumbnail_size_w', 80);
     update_option('thumbnail_size_h', 80);
     update_option('thumbnail_crop', 1);
     //        add_theme_support(
     //            'post-formats',
     //            array(
     //                'gallery',
     //                'link',
     //                'quote',
     //                'video',
     //                'audio'
     //            )
     //        );
     add_theme_support('automatic-feed-links');
     add_post_type_support('page', 'excerpt');
 }
开发者ID:pouretrebelle,项目名称:thishappened,代码行数:26,代码来源:functions-die.php

示例6: __construct

 function __construct()
 {
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_theme_support('title-tag');
     add_filter('timber_context', array($this, 'add_user_nav_info_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_filter('xv_planeta_feed', '__return_true');
     add_filter('wpseo_twitter_creator_account', function ($twitter) {
         return '@softcatala';
     });
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'sc_rewrite_search'));
     add_action('template_redirect', array($this, 'sc_change_programs_search_url_rewrite'));
     add_action('init', array($this, 'sc_author_rewrite_base'));
     add_action('template_redirect', array($this, 'fix_woosidebar_hooks'), 1);
     add_action('template_redirect', array($this, 'sc_change_search_url_rewrite'));
     add_action('after_setup_theme', array($this, 'include_theme_conf'));
     //SC Dashboard settings
     add_action('admin_menu', array($this, 'include_sc_settings'));
     spl_autoload_register(array($this, 'autoload'));
     add_post_type_support('programa', 'woosidebars');
     parent::__construct();
 }
开发者ID:softcatala,项目名称:wp-softcatala,代码行数:25,代码来源:functions.php

示例7: init

 public function init()
 {
     /**
      * Can be used to prevent SEO tools from inserting custom meta tags.
      *
      * @module seo-tools
      *
      * @since 4.4.0
      *
      * @param bool true Should Jetpack's SEO Meta Tags be enabled. Defaults to true.
      */
     if (apply_filters('jetpack_seo_meta_tags_enabled', true)) {
         add_action('wp_head', array($this, 'meta_tags'));
         // Add support for editing page excerpts in pages, regardless of theme support.
         add_post_type_support('page', 'excerpt');
     }
     /**
      * Can be used to prevent SEO tools form modifying site titles.
      *
      * @module seo-tools
      *
      * @since 4.4.0
      *
      * @param bool true Should Jetpack SEO modify site titles. Defaults to true.
      */
     if (apply_filters('jetpack_seo_custom_titles', true)) {
         // Overwrite page title with custom SEO meta title for themes that support title-tag.
         add_filter('pre_get_document_title', array('Jetpack_SEO_Titles', 'get_custom_title'));
         // Add overwrite support for themes that don't support title-tag.
         add_filter('wp_title', array('Jetpack_SEO_Titles', 'get_custom_title'));
     }
     add_filter('jetpack_open_graph_tags', array($this, 'set_custom_og_tags'));
 }
开发者ID:automattic,项目名称:jetpack,代码行数:33,代码来源:jetpack-seo.php

示例8: __construct

 function __construct()
 {
     $this->pluginURI = plugin_dir_url(__FILE__);
     $this->pluginPATH = plugin_dir_path(__FILE__);
     add_action('wp_enqueue_scripts', array(&$this, 'veuse_uikit_enqueue_styles'), 0);
     add_action('admin_enqueue_scripts', array(&$this, 'veuse_uikit_enqueue_admin_script'));
     add_action('plugins_loaded', array(&$this, 'veuse_uikit_load_textdomain'));
     add_action('admin_head', array(&$this, 'widgets_admin_page'), 100);
     /* Include widgets */
     require 'shortcodes.php';
     /* Include widgets */
     require 'widgets/page-widget.php';
     require 'widgets/image-widget-2.php';
     //require 'widgets/parallax-widget.php'; // Beta
     require 'widgets/download-widget.php';
     require 'widgets/divider-widget.php';
     require 'widgets/callout-widget.php';
     require 'widgets/toggle-widget.php';
     require 'widgets/tab-widget.php';
     require 'widgets/verticaltab-widget.php';
     require 'widgets/alert-widget.php';
     require 'widgets/button-widget.php';
     require 'widgets/iconbox-widget.php';
     require 'widgets/testimonial-widget.php';
     require 'widgets/postslider-widget.php';
     require 'widgets/posts-widget.php';
     require 'widgets/posts-grid-widget.php';
     require 'widgets/progressbar-widget.php';
     /* Add theme support */
     add_post_type_support('page', 'excerpt');
 }
开发者ID:vondervick,项目名称:veuse-uikit,代码行数:31,代码来源:veuse-uikit.php

示例9: mla_admin_init_action

 /**
  * Adds Custom Field support to the Edit Media screen.
  * Declared public because it is an action.
  *
  * @since 0.80
  *
  * @return	void	echoes the HTML markup for the label and value
  */
 public static function mla_admin_init_action()
 {
     static $mc_att_category_metabox = array();
     /*
      * Enable the enhanced "Media Categories" searchable metaboxes for hiearchical taxonomies
      */
     if (class_exists('Media_Categories') && ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_CATEGORY_METABOX) || 'checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_TAG_METABOX))) {
         $taxonomies = get_taxonomies(array('show_ui' => true), 'objects');
         foreach ($taxonomies as $key => $value) {
             if (MLAOptions::mla_taxonomy_support($key)) {
                 if ($value->hierarchical) {
                     if ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_CATEGORY_METABOX)) {
                         $mc_att_category_metabox[] = new Media_Categories($key);
                     }
                 } else {
                     if ('checked' == MLAOptions::mla_get_option(MLAOptions::MLA_MEDIA_MODAL_DETAILS_TAG_METABOX)) {
                         $mc_att_category_metabox[] = new Media_Categories($key);
                     }
                 }
                 // flat
             }
             // is supported
         }
         // foreach
     }
     // class_exists
     add_post_type_support('attachment', 'custom-fields');
 }
开发者ID:rongandat,项目名称:best-picture,代码行数:36,代码来源:class-mla-edit-media.php

示例10: spacious_setup

 function spacious_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      */
     load_theme_textdomain('spacious', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page.
     add_theme_support('post-thumbnails');
     // Supporting title tag via add_theme_support (since WordPress 4.1)
     add_theme_support('title-tag');
     // Registering navigation menus.
     register_nav_menus(array('primary' => __('Primary Menu', 'spacious'), 'footer' => __('Footer Menu', 'spacious')));
     // Cropping the images to different sizes to be used in the theme
     add_image_size('featured-blog-large', 750, 350, true);
     add_image_size('featured-blog-medium', 270, 270, true);
     add_image_size('featured', 642, 300, true);
     add_image_size('featured-blog-medium-small', 230, 230, true);
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('spacious_custom_background_args', array('default-color' => 'eaeaea')));
     // Adding excerpt option box for pages as well
     add_post_type_support('page', 'excerpt');
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
 }
开发者ID:andrewfieldwmg,项目名称:greenschoolsproject,代码行数:30,代码来源:functions.php

示例11: alfath_setup

/**
 * Alfath initial setup and constants
 */
function alfath_setup()
{
    // Make theme available for translation
    load_theme_textdomain('alfath', get_template_directory() . '/lang');
    // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)
    register_nav_menus(array('primary_navigation' => __('Primary Navigation', 'alfath')));
    register_nav_menus(array('before_mobile_navigation' => __('Before Mobile Navigation', 'alfath')));
    register_nav_menus(array('mobile_navigation' => __('Mobile Navigation', 'alfath')));
    register_nav_menus(array('fixed_left_navigation' => __('Fixed Left Navigation', 'alfath')));
    register_nav_menus(array('footer_navigation' => __('Footer Navigation', 'alfath')));
    // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)
    add_theme_support('post-thumbnails');
    add_image_size('bottom-thumbnail', 330);
    add_image_size('slide-image', 1140, 431);
    add_image_size('slide-image2', 665, 385, true, array('left', 'top'));
    add_image_size('slide-thumbnail', 150, 75, true);
    add_image_size('post-thumbnail', 750, 9999);
    add_image_size('sticky-thumbnail', 370, 247, true);
    add_image_size('regular-thumbnail', 300, 185, true);
    update_option('thumbnail_size_w', 150);
    update_option('thumbnail_size_h', 75);
    set_post_thumbnail_size(750, 9999, false);
    add_post_type_support('page', 'excerpt');
    // add_image_size('category-thumb', 300, 9999); // 300px wide (and unlimited height)
    // Add post formats (http://codex.wordpress.org/Post_Formats)
    // add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
    add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
    // Tell the TinyMCE editor to use a custom stylesheet
    add_editor_style('/assets/css/editor-style.css');
}
开发者ID:ArgiaCyber,项目名称:alfath,代码行数:33,代码来源:init.php

示例12: setup_globals

 /**
  * Set up global settings for the blogs component.
  *
  * The BP_BLOGS_SLUG constant is deprecated, and only used here for
  * backwards compatibility.
  *
  * @since BuddyPress (1.5.0)
  *
  * @see BP_Component::setup_globals() for description of parameters.
  *
  * @param array $args See {@link BP_Component::setup_globals()}.
  */
 public function setup_globals($args = array())
 {
     $bp = buddypress();
     if (!defined('BP_BLOGS_SLUG')) {
         define('BP_BLOGS_SLUG', $this->id);
     }
     // Global tables for messaging component
     $global_tables = array('table_name' => $bp->table_prefix . 'bp_user_blogs', 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta');
     $meta_tables = array('blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta');
     // All globals for blogs component.
     $args = array('slug' => BP_BLOGS_SLUG, 'root_slug' => isset($bp->pages->blogs->slug) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 'has_directory' => is_multisite(), 'notification_callback' => 'bp_blogs_format_notifications', 'search_string' => __('Search sites...', 'buddypress'), 'autocomplete_all' => defined('BP_MESSAGES_AUTOCOMPLETE_ALL'), 'global_tables' => $global_tables, 'meta_tables' => $meta_tables);
     // Setup the globals
     parent::setup_globals($args);
     /*
      * Set up the post post type to track.
      *
      * In case the config is not multisite, the blog_public option is ignored.
      */
     if (0 !== apply_filters('bp_is_blog_public', (int) get_option('blog_public')) || !is_multisite()) {
         /**
          * Filters the post types to track for the Blog component.
          *
          * @since BuddyPress (1.5.0)
          *
          * @param array $value Array of post types to track.
          */
         $post_types = apply_filters('bp_blogs_record_post_post_types', array('post'));
         foreach ($post_types as $post_type) {
             add_post_type_support($post_type, 'buddypress-activity');
         }
     }
     // Filter the generic track parameters for the 'post' post type.
     add_filter('bp_activity_get_post_type_tracking_args', array($this, 'post_tracking_args'), 10, 2);
 }
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:46,代码来源:bp-blogs-loader.php

示例13: cuvey_setup

function cuvey_setup()
{
    global $cuvey_options;
    // Translations support. Find language files in cuvey/languages
    load_theme_textdomain('cuvey', get_template_directory() . '/languages');
    $locale = get_locale();
    $locale_file = get_template_directory() . "/languages/{$locale}.php";
    if (is_readable($locale_file)) {
        require_once $locale_file;
    }
    // Set content width
    global $content_width;
    if (!isset($content_width)) {
        $content_width = 720;
    }
    // Editor style (editor-style.css)
    add_editor_style(array('assets/css/editor-style.css'));
    // Load plugin checker
    require get_template_directory() . '/inc/plugin-activation.php';
    //Include all post types
    require get_template_directory() . '/inc/metabox.php';
    // Nav Menu (Custom menu support)
    if (function_exists('register_nav_menu')) {
        global $cuvey_options;
        register_nav_menu('primary', __('cuvey Primary Menu', 'cuvey'));
    }
    // Theme Features: Automatic Feed Links
    add_theme_support('automatic-feed-links');
    // Theme Features: Dynamic Sidebar
    add_post_type_support('post', 'simple-page-sidebars');
    // Theme Features: Post Thumbnails and custom image sizes for post-thumbnails
    add_theme_support('post-thumbnails', array('post', 'page', 'product', 'portfolio', 'team', 'event', 'menu'));
    // Theme Features: Post Formats
    add_theme_support('post-formats', array('gallery', 'image', 'link', 'quote', 'video', 'audio'));
}
开发者ID:rafinkarki,项目名称:Themes,代码行数:35,代码来源:functions.php

示例14: freedom_setup

 function freedom_setup()
 {
     /*
      * Make theme available for translation.
      * Translations can be filed in the /languages/ directory.
      */
     load_theme_textdomain('freedom', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page.
     add_theme_support('post-thumbnails');
     // Supporting title tag via add_theme_support (since WordPress 4.1)
     add_theme_support('title-tag');
     // Registering navigation menu.
     register_nav_menu('primary', 'Primary Menu');
     // Cropping the images to different sizes to be used in the theme
     add_image_size('featured', 660, 300, true);
     add_image_size('featured-home', 485, 400, true);
     // Setup the WordPress core custom background feature.
     add_theme_support('custom-background', apply_filters('freedom_custom_background_args', array('default-color' => 'eaeaea')));
     // Enable support for Post Formats.
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link', 'gallery', 'chat', 'audio', 'status'));
     // Adding excerpt option box for pages as well
     add_post_type_support('page', 'excerpt');
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
 }
开发者ID:idea-lab,项目名称:Spectrum,代码行数:30,代码来源:functions.php

示例15: custom_theme_setup

function custom_theme_setup()
{
    add_theme_support('automatic-feed-links');
    add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
    add_post_type_support('page', array('excerpt'));
    add_theme_support('post-thumbnails');
}
开发者ID:tessak22,项目名称:robichaud,代码行数:7,代码来源:functions.php


注:本文中的add_post_type_support函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。