コード例 #1
0
ファイル: blogroll.php プロジェクト: gumbysgoo/bestilblomster
 /**
  * Set up hooks that monitor added/modified/deleted bookmarks.
  *
  * @return void
  */
 function init()
 {
     parent::init();
     add_action('add_link', array($this, 'hook_add_link'));
     add_action('edit_link', array($this, 'hook_edit_link'));
     add_action('delete_link', array($this, 'hook_delete_link'));
 }
コード例 #2
0
 function init()
 {
     parent::init();
     //Intercept 2.9+ style metadata modification actions
     add_action("added_{$this->meta_type}_meta", array(&$this, 'meta_modified'), 10, 4);
     add_action("updated_{$this->meta_type}_meta", array(&$this, 'meta_modified'), 10, 4);
     add_action("deleted_{$this->meta_type}_meta", array(&$this, 'meta_modified'), 10, 4);
     //Also intercept the equivalent actions used in /wp-admin/includes/post.php.
     //(WP is bloody inconsitent. The action names differ by a single character
     //but have different argument counts)
     add_action("added_{$this->meta_type}meta", array(&$this, 'meta_modified'), 10, 4);
     add_action("deleted_{$this->meta_type}meta", array(&$this, 'meta_modified'), 10, 1);
     //NB : 1 argument!
     //When a post is deleted, also delete the custom field container associated with it.
     add_action('delete_post', array(&$this, 'post_deleted'));
     add_action('trash_post', array(&$this, 'post_deleted'));
     //Re-parse custom fields when a post is restored from trash
     add_action('untrashed_post', array(&$this, 'post_untrashed'));
 }
コード例 #3
0
 function init()
 {
     parent::init();
     add_action('post_comment', array(&$this, 'hook_post_comment'), 10, 2);
     add_action('edit_comment', array(&$this, 'hook_edit_comment'));
     add_action('transition_comment_status', array(&$this, 'hook_comment_status'), 10, 3);
     add_action('trashed_post_comments', array(&$this, 'hook_trashed_post_comments'), 10, 2);
     add_action('untrash_post_comments', array(&$this, 'hook_untrash_post_comments'));
 }
コード例 #4
0
 function init()
 {
     parent::init();
     //Intercept 2.9+ style metadata modification actions
     add_action("added_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     add_action("updated_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     add_action("deleted_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     //When a post is deleted, also delete the custom field container associated with it.
     add_action('delete_post', array($this, 'post_deleted'));
     add_action('trash_post', array($this, 'post_deleted'));
     //Re-parse custom fields when a post is restored from trash
     add_action('untrashed_post', array($this, 'post_untrashed'));
 }
コード例 #5
0
ファイル: custom_field.php プロジェクト: afftt/infos-ping
 function init()
 {
     parent::init();
     //Figure out which custom fields we're interested in.
     if (is_array($this->plugin_conf->options['custom_fields'])) {
         $prefix_formats = array('html' => 'html', 'url' => 'metadata');
         foreach ($this->plugin_conf->options['custom_fields'] as $meta_name) {
             //The user can add an optional "format:" prefix to specify the format of the custom field.
             $parts = explode(':', $meta_name, 2);
             if (count($parts) == 2 && in_array($parts[0], $prefix_formats)) {
                 $this->selected_fields[$parts[1]] = $prefix_formats[$parts[0]];
             } else {
                 $this->selected_fields[$meta_name] = 'metadata';
             }
         }
     }
     //Intercept 2.9+ style metadata modification actions
     add_action("added_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     add_action("updated_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     add_action("deleted_{$this->meta_type}_meta", array($this, 'meta_modified'), 10, 4);
     //When a post is deleted, also delete the custom field container associated with it.
     add_action('delete_post', array($this, 'post_deleted'));
     add_action('trash_post', array($this, 'post_deleted'));
     //Re-parse custom fields when a post is restored from trash
     add_action('untrashed_post', array($this, 'post_untrashed'));
 }
コード例 #6
0
 function init()
 {
     parent::init();
     //Notify the overlord that the post/container type that this instance is
     //responsible for is enabled.
     $overlord = blcPostTypeOverlord::getInstance();
     $overlord->post_type_enabled($this->container_type);
 }
コード例 #7
0
 function init()
 {
     parent::init();
     add_action('edit_comment', array(&$this, 'hook_modified_comment'));
     add_action('unspammed_comment', array(&$this, 'hook_modified_comment'));
     add_action('untrashed_comment', array(&$this, 'hook_modified_comment'));
     add_action('wp_insert_comment', array(&$this, 'hook_wp_insert_comment'), 10, 2);
     add_action('deleted_comment', array(&$this, 'hook_deleted_comment'));
     add_action('spammed_comment', array(&$this, 'hook_deleted_comment'));
     add_action('trashed_comment', array(&$this, 'hook_deleted_comment'));
     add_action('transition_comment_status', array(&$this, 'hook_comment_status'), 10, 3);
     add_action('trashed_post_comments', array(&$this, 'hook_trashed_post_comments'), 10, 2);
     add_action('untrash_post_comments', array(&$this, 'hook_untrash_post_comments'));
 }
コード例 #8
0
ファイル: custom_field.php プロジェクト: slaFFik/l10n-ru
 /**
  * Instantiate a link container.
  *
  * @param array $container An associative array of container data.
  * @return blcPostMeta
  */
 function get_container($container)
 {
     $container = parent::get_container($container);
     //Set up the parseable fields
     $fields = array();
     $conf = blc_get_configuration();
     if (is_array($conf->options['custom_fields'])) {
         foreach ($conf->options['custom_fields'] as $meta_name) {
             $fields[$meta_name] = 'metadata';
         }
     }
     $container->fields = $fields;
     return $container;
 }