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


PHP delete_metadata函数代码示例

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


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

示例1: delete_meta

 /**
  * Remove metadata matching criteria from a term.
  *
  *
  */
 public static function delete_meta($term_id, $meta_key, $meta_value = '')
 {
     if (current_theme_supports('extended-taxonomies')) {
         return delete_post_meta(self::get_post_for_extended_term($term_id)->ID, $meta_key, $meta_value);
     }
     return delete_metadata('taxonomy', $term_id, $meta_key, $meta_value);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:12,代码来源:class-term.php

示例2: execute_uninstall

 /**
  * Execute module uninstall
  *
  * @return void
  */
 public function execute_uninstall()
 {
     $this->execute_deactivate();
     delete_site_option('itsec_ssl');
     delete_metadata('post', null, 'itsec_enable_ssl', null, true);
     delete_metadata('post', null, 'bwps_enable_ssl', null, true);
 }
开发者ID:santikrass,项目名称:apache,代码行数:12,代码来源:setup.php

示例3: deleteData

function deleteData()
{
    global $wpdb;
    delete_option('asgarosforum_options');
    delete_option('asgarosforum_db_version');
    // For site options in multisite
    delete_site_option('asgarosforum_options');
    delete_site_option('asgarosforum_db_version');
    // Delete user meta data
    delete_metadata('user', 0, 'asgarosforum_moderator', '', true);
    delete_metadata('user', 0, 'asgarosforum_banned', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_topic', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_forum', '', true);
    delete_metadata('user', 0, 'asgarosforum_subscription_global_topics', '', true);
    delete_metadata('user', 0, 'asgarosforum_unread_cleared', '', true);
    delete_metadata('user', 0, 'asgarosforum_unread_exclude', '', true);
    // Delete terms
    $terms = $wpdb->get_col('SELECT t.term_id FROM ' . $wpdb->terms . ' AS t INNER JOIN ' . $wpdb->term_taxonomy . ' AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = "asgarosforum-category";');
    foreach ($terms as $term) {
        wp_delete_term($term, 'asgarosforum-category');
    }
    // Drop custom tables
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_forums;");
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_threads;");
    $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}forum_posts;");
    // Delete uploaded files
    $upload_dir = wp_upload_dir();
    $upload_path = $upload_dir['basedir'] . '/asgarosforum/';
    recursiveDelete($upload_path);
    // Delete themes
    $theme_path = WP_CONTENT_DIR . '/themes-asgarosforum';
    recursiveDelete($theme_path);
    // Delete data which has been used in old versions of the plugin.
    delete_metadata('user', 0, 'asgarosforum_lastvisit', '', true);
}
开发者ID:Asgaros,项目名称:asgaros-forum,代码行数:35,代码来源:uninstall.php

示例4: _wp_autosave_post_revisioned_meta_fields

 /**
  * Autosave the revisioned meta fields.
  *
  * Iterates thru the revisioned meta fields and checks each to see if they are set,
  * and have a changed value. If so, the meta value is saved and attached to the autosave.
  *
  * @since 4.5.0
  *
  * @param Post object $new_autosave The new post being autosaved.
  */
 public function _wp_autosave_post_revisioned_meta_fields($new_autosave)
 {
     /**
      * The post data arrives as either $_POST['data']['wp_autosave'] or the $_POST
      * itself. This sets $posted_data to the correct variable.
      */
     $posted_data = isset($_POST['data']) ? $_POST['data']['wp_autosave'] : $_POST;
     /**
      * Go thru the revisioned meta keys and save them as part of the autosave, if
      * the meta key is part of the posted data, the meta value is not blank and
      * the the meta value has changes from the last autosaved value.
      */
     foreach ($this->_wp_post_revision_meta_keys() as $meta_key) {
         if (isset($posted_data[$meta_key]) && get_post_meta($new_autosave['ID'], $meta_key, true) != wp_unslash($posted_data[$meta_key])) {
             /*
              * Use the underlying delete_metadata() and add_metadata() functions
              * vs delete_post_meta() and add_post_meta() to make sure we're working
              * with the actual revision meta.
              */
             delete_metadata('post', $new_autosave['ID'], $meta_key);
             /**
              * One last check to ensure meta value not empty().
              */
             if (!empty($posted_data[$meta_key])) {
                 /**
                  * Add the revisions meta data to the autosave.
                  */
                 add_metadata('post', $new_autosave['ID'], $meta_key, $posted_data[$meta_key]);
             }
         }
     }
 }
开发者ID:khromov,项目名称:wp-post-meta-revisions,代码行数:42,代码来源:wp-post-meta-revisions.php

示例5: wowslider_install

function wowslider_install($undo = false)
{
    global $wpdb;
    $table = $wpdb->prefix . 'wowslider';
    if ($undo) {
        $wpdb->query("DROP TABLE {$table};");
        delete_metadata('user', 0, 'wowslider_last_view', '', true);
        delete_metadata('user', 0, 'wp_wowslider_sliders_per_page', '', true);
        delete_metadata('user', 0, 'managewowslider_sliderscolumnshidden', '', true);
    } else {
        $charset_collate = '';
        if (!empty($wpdb->charset)) {
            $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
        }
        if (!empty($wpdb->collate)) {
            $charset_collate .= " COLLATE {$wpdb->collate}";
        }
        $queries = "CREATE TABLE {$table} (\n          ID bigint(20) unsigned NOT NULL auto_increment,\n          slider_name varchar(200) NOT NULL,\n          slider_author bigint(20) unsigned NOT NULL default '0',\n          slider_date datetime NOT NULL default '0000-00-00 00:00:00',\n          slider_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',\n          slider_public tinyint(3) unsigned NOT NULL default '1',\n          slider_images text NOT NULL,\n          PRIMARY KEY  (ID),\n          KEY slider_name (slider_name),\n          KEY slider_author (slider_author),\n          KEY slider_public (slider_public),\n          KEY slider_date (slider_date)\n        ) {$charset_collate};";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($queries);
        if (is_dir(WOWSLIDER_PLUGIN_PATH . 'sliders/1/')) {
            $wpdb->query('INSERT INTO ' . $table . ' VALUES (1, \'WOW Slider\', 1, \'2011-09-01 02:00:00\', \'2011-09-01 02:00:00\', 1, \'a:3:{i:0;s:13:"slide1new.jpg";i:1;s:13:"slide2new.jpg";i:2;s:13:"slide3new.jpg";}\');');
        }
    }
    return true;
}
开发者ID:rmaloney,项目名称:simplewp_restaurant,代码行数:26,代码来源:api.php

示例6: wowslider_install

function wowslider_install($undo = false)
{
    global $wp_filesystem, $wpdb;
    $table = $wpdb->prefix . 'wowslider';
    if ($undo) {
        $wpdb->query("DROP TABLE {$table};");
        require_once ABSPATH . 'wp-admin/includes/file.php';
        if (!$wp_filesystem || !is_object($wp_filesystem)) {
            WP_Filesystem();
        }
        $wp_filesystem->delete(wowslider_upload_dir(), true);
        delete_metadata('user', 0, 'wowslider_last_view', '', true);
        delete_metadata('user', 0, 'wp_wowslider_sliders_per_page', '', true);
        delete_metadata('user', 0, 'managewowslider_sliderscolumnshidden', '', true);
    } else {
        $charset_collate = '';
        if (!empty($wpdb->charset)) {
            $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
        }
        if (!empty($wpdb->collate)) {
            $charset_collate .= " COLLATE {$wpdb->collate}";
        }
        $queries = "CREATE TABLE {$table} (\n          ID bigint(20) unsigned NOT NULL auto_increment,\n          slider_name varchar(200) NOT NULL,\n          slider_author bigint(20) unsigned NOT NULL default '0',\n          slider_date datetime NOT NULL default '0000-00-00 00:00:00',\n          slider_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',\n          slider_public tinyint(3) unsigned NOT NULL default '1',\n          slider_images text NOT NULL,\n          PRIMARY KEY  (ID),\n          KEY slider_name (slider_name),\n          KEY slider_author (slider_author),\n          KEY slider_public (slider_public),\n          KEY slider_date (slider_date)\n        ) {$charset_collate};";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($queries);
        if (is_dir(WOWSLIDER_PLUGIN_PATH . 'install/')) {
            wowslider_add(WOWSLIDER_PLUGIN_PATH . 'install/');
        }
    }
    return true;
}
开发者ID:fwelections,项目名称:fwelections,代码行数:31,代码来源:api.php

示例7: hocwp_term_delete_meta

function hocwp_term_delete_meta($term_id, $meta_key, $meta_value = '', $delete_all = false)
{
    $version = hocwp_get_wp_version();
    if (version_compare($version, '4.4', '>=')) {
        return delete_term_meta($term_id, $meta_key, $meta_value);
    }
    return delete_metadata('term', $term_id, $meta_value, $meta_value, $delete_all);
}
开发者ID:skylarkcob,项目名称:hocwp-projects,代码行数:8,代码来源:term-meta.php

示例8: unlink

 /**
  * "Unlink"-ing a custom fields removes all metadata fields that contain the specified URL.
  *
  * @param string $field_name
  * @param blcParser $parser_type
  * @param string $url
  * @param string $raw_url
  * @return bool|WP_Error True on success, or an error object if something went wrong.
  */
 function unlink($field_name, $parser, $url, $raw_url = '')
 {
     $rez = delete_metadata($this->meta_type, $this->container_id, $field_name, $raw_url);
     if ($rez) {
         return true;
     } else {
         return new WP_Error('metadata_delete_failed', sprintf(__("Failed to delete the meta field '%s' on %s [%d]", 'broken-link-checker'), $field, $this->meta_type, $this->container_id));
     }
 }
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:18,代码来源:custom_field.php

示例9: yith_vendors_plugin_update_1_8_1

function yith_vendors_plugin_update_1_8_1()
{
    $plugin_version = get_option('yith_wcmv_version', '1.0.0');
    if (version_compare($plugin_version, YITH_Vendors()->version, '<')) {
        // _money_spent and _order_count may be out of sync - clear them
        delete_metadata('user', 0, '_money_spent', '', true);
        delete_metadata('user', 0, '_order_count', '', true);
    }
}
开发者ID:yarwalker,项目名称:ecobyt,代码行数:9,代码来源:functions.yith-update.php

示例10: restoreRevision

 /**
  * @param $postId
  * @param $revisionId
  */
 public function restoreRevision($postId, $revisionId)
 {
     $key = $this->getKey();
     $revisionValues = get_post_meta($revisionId, $key, false);
     delete_metadata('post', $revisionId, $key);
     foreach ($revisionValues as $revisionValue) {
         add_metadata('post', $revisionId, $key, $revisionValue);
     }
 }
开发者ID:tmf,项目名称:wp-metabox-helper,代码行数:13,代码来源:trait-multi-metavalue-item-revision-aware.php

示例11: a3_lazy_load_activated

function a3_lazy_load_activated()
{
    update_option('a3_lazy_load_version', '1.4.0');
    // Set Settings Default from Admin Init
    global $a3_lazy_load_admin_init;
    $a3_lazy_load_admin_init->set_default_settings();
    delete_metadata('user', 0, $a3_lazy_load_admin_init->plugin_name . '-' . 'plugin_framework_global_box' . '-' . 'opened', '', true);
    update_option('a3_lazy_load_just_installed', true);
}
开发者ID:satishux,项目名称:fitnesshack,代码行数:9,代码来源:a3-lazy-load-admin.php

示例12: _remove_data

 /**
  * Remove data.
  */
 private function _remove_data()
 {
     // Remove options.
     foreach ($this->options as $name => $value) {
         delete_option($name);
     }
     // Remove user meta.
     delete_metadata('user', null, 'ab_dismiss_admin_notice', '', true);
 }
开发者ID:patrickcurl,项目名称:monks,代码行数:12,代码来源:installer.php

示例13: wpex_after_update

function wpex_after_update()
{
    // Define dir
    $dir = WPEX_FRAMEWORK_DIR . 'updates/';
    // Get theme version
    $theme_version = WPEX_THEME_VERSION;
    // Get user version
    $version = get_option('total_version');
    $version = $version ? $version : '2.1.3';
    // needs something
    // Migrate redux options
    if (!get_option('wpex_customizer_migration_complete') && get_option('wpex_options')) {
        require_once $dir . 'redux-migrate.php';
    } else {
        update_option('wpex_customizer_migration_complete', 'completed');
    }
    // Reset plugin notification and enable
    if ($version != WPEX_THEME_VERSION) {
        set_theme_mod('recommend_plugins_enable', true);
        delete_metadata('user', null, 'tgmpa_dismissed_notice_wpex_theme', null, true);
    }
    // Display Notice if Supported version of VC is smaller then current version
    if (defined('WPB_VC_VERSION') && apply_filters('wpex_display_outdated_vc_notice', true) && version_compare(WPEX_VC_SUPPORTED_VERSION, WPB_VC_VERSION, '>')) {
        // Make sure TGMA is running
        set_theme_mod('recommend_plugins_enable', true);
        delete_metadata('user', null, 'tgmpa_dismissed_notice_wpex_theme', null, true);
        // Don't display notice anymore...@since 3.1.1
        /*
        		require_once( $dir .'update-front-end-notice.php' );
        		new WPEX_Update_Front_End_Notice( array(
        			'title'   => 'Total v'. $theme_version,
        			'content' => 'vc_notice',
        		) );*/
    }
    // Lets add an initial version that tells me when they first activated the theme, this never changes
    if (!get_option('total_initial_version')) {
        update_option('total_initial_version', $theme_version);
    }
    // Save all mods to a backup option incase something goes wrong
    function wpex_backup_mods()
    {
        global $wpex_theme_mods;
        update_option('wpex_total_customizer_backup', $wpex_theme_mods);
    }
    // Version 3.0.0 Update
    if ($version < '3.0.0') {
        wpex_backup_mods();
        // Backup first
        $file = WPEX_FRAMEWORK_DIR . 'updates/update-3_0_0.php';
        if (file_exists($file)) {
            require_once $file;
        }
    }
    // Update theme version
    update_option('total_version', $theme_version);
}
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:56,代码来源:after-update.php

示例14: test_delete_all_post_meta_is_synced

 public function test_delete_all_post_meta_is_synced()
 {
     add_post_meta($this->post_id, $this->whitelisted_post_meta, 'foo');
     delete_metadata('post', $this->post_id, $this->whitelisted_post_meta, '', true);
     $this->sender->do_sync();
     $meta_key_value = $this->server_replica_storage->get_metadata('post', $this->post_id, $this->whitelisted_post_meta, true);
     $meta_key_array = $this->server_replica_storage->get_metadata('post', $this->post_id, $this->whitelisted_post_meta);
     $this->assertEquals(get_post_meta($this->post_id, $this->whitelisted_post_meta, true), $meta_key_value);
     $this->assertEquals(get_post_meta($this->post_id, $this->whitelisted_post_meta), $meta_key_array);
 }
开发者ID:automattic,项目名称:jetpack,代码行数:10,代码来源:test_class.jetpack-sync-meta.php

示例15: delete

 /**
  * Delete a meta field.
  *
  * @synopsis <id> <key>
  */
 public function delete($args, $assoc_args)
 {
     list($object_id, $meta_key) = $args;
     $success = \delete_metadata($this->meta_type, $object_id, $meta_key);
     if ($success) {
         \WP_CLI::success("Deleted custom field.");
     } else {
         \WP_CLI::error("Failed to delete custom field.");
     }
 }
开发者ID:nb,项目名称:wp-cli,代码行数:15,代码来源:CommandWithMeta.php


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