當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Component::start方法代碼示例

本文整理匯總了PHP中BP_Component::start方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Component::start方法的具體用法?PHP BP_Component::start怎麽用?PHP BP_Component::start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Component的用法示例。


在下文中一共展示了BP_Component::start方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 /**
  * Constructor
  *
  * @package CollabPress
  * @subpackage CP BP
  * @since 1.2
  */
 function __construct()
 {
     global $bp;
     parent::start('collabpress', __('CollabPress', 'collabpress'), COLLABPRESS_PLUGIN_DIR);
     // Register ourselves as an active BP component
     $bp->active_components['collabpress'] = '1';
     add_filter('bp_get_template_stack', array($this, 'add_cp_to_template_stack'));
     // Register BP-specific taxonomies
     $this->register_taxonomies();
     // Set up the CP query
     add_action('cp_bp_setup_item', array(&$this, 'do_cp_query'), 5);
     // Load the notification framework
     require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-notifications.php';
     // Load the Groups integration, if active
     if (bp_is_active('groups')) {
         require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-groups.php';
         bp_register_group_extension('CP_BP_Group_Extension');
     }
     // Add the admin menus
     add_action('cp_after_advanced_settings', array(&$this, 'render_settings'));
     // Todo: this MUST check to see whether we're in a BP context!!
     add_filter('cp_calendar_permalink', array($this, 'filter_cp_calendar_permalink'), 10, 4);
     add_filter('post_type_link', array(&$this, 'filter_permalinks'), 10, 4);
     add_filter('cp_task_list_link', array(&$this, 'filter_item_link'), 10, 3);
     add_filter('cp_task_link', array(&$this, 'filter_item_link'), 10, 3);
     add_action('cp_project_added', array(&$this, 'mark_post_in_group'));
     add_action('wp_print_styles', array(&$this, 'enqueue_styles'));
 }
開發者ID:clarkewd,項目名稱:CollabPress,代碼行數:35,代碼來源:cp-bp.php

示例2: define

 /**
  * Constructor method
  *
  * You can do all sorts of stuff in your constructor, but it's recommended that, at the
  * very least, you call the parent::start() function. This tells the parent BP_Component
  * to begin its setup routine.
  *
  * BP_Component::start() takes three parameters:
  *   (1) $id   - A unique identifier for the component. Letters, numbers, and underscores
  *		 only.
  *   (2) $name - This is a translatable name for your component, which will be used in
  *               various places through the BuddyPress admin screens to identify it.
  *   (3) $path - The path to your plugin directory. Primarily, this is used by
  *		 BP_Component::includes(), to include your plugin's files. See loader.php
  *		 to see how BP_course_PLUGIN_DIR was defined.
  *
  * @package BuddyPress_Course_Component
  * @since 1.6
  */
 function __construct()
 {
     global $bp;
     parent::start(BP_COURSE_SLUG, __('Course', 'vibe'), BP_COURSE_MOD_PLUGIN_DIR);
     if (!defined('BP_COURSE_RESULTS_SLUG')) {
         define('BP_COURSE_RESULTS_SLUG', 'course-results');
     }
     if (!defined('BP_COURSE_STATS_SLUG ')) {
         define('BP_COURSE_STATS_SLUG', 'course-stats');
     }
     /**
      * BuddyPress-dependent plugins are loaded too late to depend on BP_Component's
      * hooks, so we must call the function directly.
      */
     $this->includes();
     /**
      * Put your component into the active components array, so that
      *   bp_is_active( 'course' );
      * returns true when appropriate. We have to do this manually, because non-core
      * components are not saved as active components in the database.
      */
     $bp->active_components[$this->id] = '2';
     /**
      * Hook the register_post_types() method. If you're using custom post types to store
      * data (which is recommended), you will need to hook your function manually to
      * 'init'.
      */
     add_action('init', array(&$this, 'register_post_types'));
 }
開發者ID:Nguyenkain,項目名稱:Elearning,代碼行數:48,代碼來源:bp-course-loader.php

示例3:

 function __construct()
 {
     global $bp;
     parent::start('social_articles', __('Social Articles', 'articles'), SA_BASE_PATH);
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
開發者ID:Dannypid,項目名稱:Tinymce-social-articles-1.8,代碼行數:7,代碼來源:social-articles-load.php

示例4:

 /**
  * Constructor
  *
  * @since 1.2
  */
 function __construct()
 {
     global $bp;
     parent::start('bp_docs', __('BuddyPress Docs', 'bp-docs'), BP_DOCS_INSTALL_PATH);
     $bp->active_components[$this->id] = '1';
     $this->setup_hooks();
 }
開發者ID:pausaura,項目名稱:agora_nodes,代碼行數:12,代碼來源:component.php

示例5: buddypress

 /**
  * Constructor method
  *
  * @package BP Reshare
  * @subpackage Component
  * @since 1.0
  *
  * @uses buddyreshare_get_component_id() to get the id of the component
  * @uses buddyreshare_get_component_name() to get the name of the component
  * @uses buddyreshare_get_includes_dir() to get plugin's include dir
  * @uses buddypress() to get BuddyPress main instance
  */
 function __construct()
 {
     parent::start(buddyreshare_get_component_id(), buddyreshare_get_component_name(), buddyreshare_get_includes_dir());
     buddypress()->active_components[$this->id] = '1';
     $this->includes();
     $this->setup_hooks();
 }
開發者ID:socialray,項目名稱:surfied-2-0,代碼行數:19,代碼來源:component.php

示例6: __construct

 /**
  * Start the site subscriber component creation process
  */
 public function __construct()
 {
     parent::start('site_subscriber', __('Site Subscriber', 'bp-site-subscriber'), BP_PLUGIN_DIR);
     // Wordpress init
     add_action('init', array($this, 'init'));
     /**
      * Actions and filters for notification adding and deleting
      */
     // Add new notification when a new post is published
     add_action('publish_post', array($this, 'add_notification'), 10, 2);
     // Mark users notification connected to a post as read
     add_action('the_post', array($this, 'mark_notification_as_read'));
     // Delete notifications if post is deleted
     add_action('delete_post', array($this, 'delete_notifications'));
     // Delete notifications if post is trashed
     add_action('wp_trash_post', array($this, 'delete_notifications'));
     /**
      * Actions and filters for subscribing
      */
     add_action('wp_ajax_bp_site_subscriber_subscribe', array($this, 'change_subscription'));
     /**
      * Actions and filters for settings
      */
     // Action run when displaying notification settings (enable or disable emails)
     add_action('bp_notification_settings', array($this, 'settings_screen'));
 }
開發者ID:lakrisgubben,項目名稱:BP-Site-Subscriber,代碼行數:29,代碼來源:notifier.php

示例7: __construct

 /**
  * Initialize component
  */
 public function __construct()
 {
     parent::start('buddyblog', __('BuddyBlog', 'buddyblog'), untrailingslashit(plugin_dir_path(__FILE__)));
     $this->includes();
     //load files
     buddypress()->active_components[$this->id] = 1;
 }
開發者ID:poweronio,項目名稱:mbsite,代碼行數:10,代碼來源:buddyblog-loader.php

示例8: __construct

 /**
  * Initiate the class
  *
  * @package BuddyForms
  * @since 0.1 beta
  */
 public function __construct()
 {
     global $bp;
     parent::start($this->id, 'BuddyForms', BUDDYFORMS_MEMBERS_INSTALL_PATH);
     $bp->active_components[$this->id] = '1';
     $this->setup_hooks();
 }
開發者ID:kishoresahoo,項目名稱:BuddyForms-Members,代碼行數:13,代碼來源:member-extention.php

示例9:

 function __construct()
 {
     global $bp;
     parent::start('buatp', __('User Account Type', 'buatp'), BUATP_ROOT . '_inc');
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
開發者ID:jfeliweb,項目名稱:BuddyPress-User-Account-Type,代碼行數:7,代碼來源:buatp-core-loader.php

示例10: buddypress

 function __construct()
 {
     parent::start('links', _x('User Links', 'Link screen page <title>', 'buddypress-links'), BP_LINKS_PLUGIN_DIR);
     $this->includes();
     bp_links_init_settings();
     buddypress()->active_components[$this->id] = '1';
 }
開發者ID:OxBEEF,項目名稱:merge-server,代碼行數:7,代碼來源:bp-links-component.php

示例11: dirname

 /**
  * Start the creation process.
  *
  * @since 1.0.0
  * @access public
  */
 function __construct()
 {
     global $bp;
     parent::start('mute', __('Mute', 'buddypress-mute'), dirname(dirname(__FILE__)));
     $this->includes();
     $bp->active_components[$this->id] = '1';
 }
開發者ID:sbrajesh,項目名稱:buddypress-mute,代碼行數:13,代碼來源:class-mute-component.php

示例12: __construct

 /**
  * Initialize the component
  */
 public function __construct()
 {
     global $bp;
     parent::start('portfolio', __('Portfolio', 'bp-portfolio'), BP_PORTFOLIO_PLUGIN_DIR);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     // add_action('init', array(&$this, 'register_post_types'));
 }
開發者ID:ncrocfer,項目名稱:BP-Portfolio,代碼行數:11,代碼來源:bp-portfolio-loader.php

示例13:

 function __construct()
 {
     global $bp;
     parent::start('events', __('Events', 'dbem'), EM_DIR);
     $this->includes();
     //TODO make BP component optional
     $bp->active_components[$this->id] = '1';
 }
開發者ID:batruji,項目名稱:metareading,代碼行數:8,代碼來源:bp-em-core.php

示例14: array

 /**
  * Constructor for the BuddyPress Media Component
  * 
  * @since BP Media 2.0
  */
 function __construct()
 {
     global $bp;
     parent::start(BP_MEDIA_SLUG, BP_MEDIA_LABEL, BP_MEDIA_PLUGIN_DIR);
     $this->includes();
     $bp->active_components[$this->id] = '1';
     add_action('init', array(&$this, 'register_post_types'));
 }
開發者ID:rolandinsh,項目名稱:buddypress-media,代碼行數:13,代碼來源:bp-media-loader.php

示例15: __construct

 /**
  * Start the forums component creation process
  *
  * @since bbPress (r3552)
  */
 public function __construct()
 {
     parent::start('forums', __('Forums', 'bbpress'), bbpress()->includes_dir . 'extend/buddypress/');
     $this->includes();
     $this->setup_globals();
     $this->setup_actions();
     $this->fully_loaded();
 }
開發者ID:danielcoats,項目名稱:schoolpress,代碼行數:13,代碼來源:loader.php


注:本文中的BP_Component::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。