本文整理汇总了PHP中flush_rewrite_rules函数的典型用法代码示例。如果您正苦于以下问题:PHP flush_rewrite_rules函数的具体用法?PHP flush_rewrite_rules怎么用?PHP flush_rewrite_rules使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flush_rewrite_rules函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: create_debatepost_type
function create_debatepost_type()
{
$labels = array('name' => 'Debates', 'singular_name' => 'Debate', 'menu_name' => 'Debates', 'all_items' => 'All Debates', 'view_item' => 'View Debate', 'add_new' => 'Add Debate', 'parent_item_colon' => '');
$args = array('labels' => $labels, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'rewrite' => array('slug' => 'debate'), 'menu_position' => null, 'has_archive' => true, 'publicly_queryable' => true, 'capability_type' => 'post');
register_post_type('debate', $args);
flush_rewrite_rules();
}
开发者ID:CyberPractices,项目名称:oxford-debate-wplugin,代码行数:7,代码来源:oxd.php
示例2: updater
/**
* Handle Updates
*/
public function updater()
{
if (version_compare(JOB_MANAGER_VERSION, get_option('wp_job_manager_version'), '>')) {
WP_Job_Manager_Install::install();
flush_rewrite_rules();
}
}
开发者ID:rafpro,项目名称:WP-Job-Manager,代码行数:10,代码来源:wp-job-manager.php
示例3: update_rewrite_rules
function update_rewrite_rules($value, $old_value)
{
remove_filter('pre_update_option_rewrite_rules', array($this, 'update_rewrite_rules'), 100, 2);
$this->add_endpoints();
flush_rewrite_rules();
return $value;
}
开发者ID:helgatheviking,项目名称:woocommerce-multilingual,代码行数:7,代码来源:endpoints.class.php
示例4: wpl_toolskit_gallery_taxomomy
/**
* Register Custom Taxonomy
*
* @since 1.0.0
*/
public function wpl_toolskit_gallery_taxomomy()
{
$labels = array('name' => _x($this->wpl_get_name_singular() . ' ' . 'Categories', 'Taxonomy General Name', 'charitylife-toolskit'), 'singular_name' => _x($this->wpl_get_name_singular() . ' ' . 'Category', 'Taxonomy Singular Name', 'charitylife-toolskit'), 'menu_name' => __($this->wpl_get_name_singular() . ' ' . 'Categories', 'charitylife-toolskit'), 'all_items' => __('All Categories', 'charitylife-toolskit'), 'parent_item' => __('Parent Category', 'charitylife-toolskit'), 'parent_item_colon' => __('Parent Category:', 'charitylife-toolskit'), 'new_item_name' => __('New Category Name', 'charitylife-toolskit'), 'add_new_item' => __('Add New Category', 'charitylife-toolskit'), 'edit_item' => __('Edit Category', 'charitylife-toolskit'), 'update_item' => __('Update Category', 'charitylife-toolskit'), 'view_item' => __('View Category', 'charitylife-toolskit'), 'separate_items_with_commas' => __('Separate items with commas', 'charitylife-toolskit'), 'add_or_remove_items' => __('Add or remove items', 'charitylife-toolskit'), 'choose_from_most_used' => __('Choose from the most used', 'charitylife-toolskit'), 'popular_items' => __('Popular Categories', 'charitylife-toolskit'), 'search_items' => __('Search Categories', 'charitylife-toolskit'), 'not_found' => __('Not Found', 'charitylife-toolskit'));
$args = array('labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'show_tagcloud' => false, 'rewrite' => array('slug' => $this->wpl_get_category_url_rewrite()));
register_taxonomy('wpl_gallery_category', array('post_gallery'), $args);
flush_rewrite_rules();
}
开发者ID:craighays,项目名称:nsfhp,代码行数:12,代码来源:gallery.php
示例5: display_clink_main_slug
function display_clink_main_slug()
{
// validate and update clink_main_slug value
$clink_main_slug_option = get_option('clink_main_slug');
if ($clink_main_slug_option) {
$clink_main_slug_option = str_replace(' ', '-', $clink_main_slug_option);
// Replaces all spaces with hyphens.
$clink_main_slug_option = preg_replace('/[^A-Za-z0-9\\-]/', '', $clink_main_slug_option);
// Removes special chars.
update_option('clink_main_slug', $value = $clink_main_slug_option);
$clink_main_slug_option = get_option('clink_main_slug');
} elseif (empty($clink_main_slug_option)) {
update_option('clink_main_slug', $value = 'clink');
$clink_main_slug_option = get_option('clink_main_slug');
}
// Flush rewrite rules after Clink settings update
if (isset($_GET['settings-updated'])) {
flush_rewrite_rules();
}
$clink_slug_structure = get_bloginfo('url') . '/' . $clink_main_slug_option . '/link-name';
?>
<input type="text" name="clink_main_slug" id="clink_main_slug" value="<?php
echo $clink_main_slug_option;
?>
" />
<p class="description clink-description"><?php
_e('Enter the clink plugin base slug for links. In default it set to <code>clink</code>', 'aryan-themes');
?>
</p>
<p class="description clink-description"><?php
printf(__('Current links structure is like: <code>%s</code>', 'aryan-themes'), $clink_slug_structure);
?>
</p>
<?php
}
开发者ID:aryanthemes,项目名称:Clink,代码行数:35,代码来源:admin.php
示例6: _deactivate
protected function _deactivate($networkwide)
{
// FIXME don't flush rewrite rules at network deactivation. See #32471
if (!$networkwide) {
flush_rewrite_rules();
}
}
开发者ID:santikrass,项目名称:apache,代码行数:7,代码来源:install.php
示例7: upgrade
public function upgrade($old_db_version = false)
{
global $wpdb;
//$frm_db_version is the version of the database we're moving to
$frm_db_version = FrmAppHelper::$db_version;
$old_db_version = (double) $old_db_version;
if (!$old_db_version) {
$old_db_version = get_option('frm_db_version');
}
if ($frm_db_version != $old_db_version) {
// update rewrite rules for views and other custom post types
flush_rewrite_rules();
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
$this->create_tables();
$this->migrate_data($frm_db_version, $old_db_version);
/***** SAVE DB VERSION *****/
update_option('frm_db_version', $frm_db_version);
/**** ADD/UPDATE DEFAULT TEMPLATES ****/
FrmXMLController::add_default_templates();
}
do_action('frm_after_install');
/**** update the styling settings ****/
if (is_admin() && function_exists('get_filesystem_method')) {
$frm_style = new FrmStyle();
$frm_style->update('default');
}
}
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:27,代码来源:FrmDb.php
示例8: book_init
/**
* Custom post type - Book
*/
function book_init()
{
$labels = array('name' => 'Books', 'singular_name' => 'Book', 'add_new' => 'Add New', 'add_new_item' => 'Add New Book', 'edit_item' => 'Edit Book', 'new_item' => 'New Book', 'view_item' => 'View Book', 'search_items' => 'Search Books', 'not_found' => 'No books found', 'not_found_in_trash' => 'No books found in Trash');
$args = array('labels' => $labels, 'description' => 'A custom post type that holds my books', 'public' => true, 'rewrite' => array('slug' => 'books'), 'has_archive' => true, 'taxonomies' => array('book_category'), 'supports' => array('title', 'editor', 'author', 'excerpt', 'custom-fields', 'thumbnail'));
register_post_type('book', $args);
flush_rewrite_rules();
}
开发者ID:csp5096,项目名称:PBR-World.com,代码行数:10,代码来源:functions.php
示例9: options_page
public static function options_page()
{
$tab = self::current_tab();
?>
<div class="wrap">
<?php
self::plugin_options_tabs();
?>
<form method="post" action="options.php" class="options-form">
<?php
settings_fields($tab);
?>
<?php
do_settings_sections($tab);
?>
<?php
if (WP_REST_API_Log_Settings_Help::$settings_key !== $tab) {
submit_button(__('Save Changes'), 'primary', 'submit', true);
}
?>
</form>
</div>
<?php
$settings_updated = filter_input(INPUT_GET, 'settings-updated', FILTER_SANITIZE_STRING);
if (!empty($settings_updated)) {
do_action('wp-rest-api-log-settings-updated');
flush_rewrite_rules();
}
}
开发者ID:petenelson,项目名称:wp-rest-api-log,代码行数:29,代码来源:class-wp-rest-api-log-settings.php
示例10: partners
function partners()
{
$labels = array('name' => _x('Partners', 'post type general name'), 'singular_name' => _x('Partners', 'post type singular name'), 'add_new' => __('Add New'), 'add_new_item' => __('Add New Partners'), 'edit_item' => __('Edit Partners'), 'new_item' => __('New Partners'), 'all_items' => __('All Partners'), 'view_item' => __('View Partners'), 'search_items' => __('Search Partners'), 'not_found' => __('No partners found.'), 'not_found_in_trash' => __('No partners found in the Trash.'), 'parent_item_colon' => '', 'menu_name' => 'Partners');
$args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'capability_type' => 'post', 'supports' => array('title', 'editor', 'thumbnail'), 'hierarchical' => true);
register_post_type('partners', $args);
flush_rewrite_rules();
}
开发者ID:khier0406,项目名称:custom_wp_plugins,代码行数:7,代码来源:partners.php
示例11: zerif_flush
function zerif_flush()
{
if (!get_option('zerif_flush_rewrite_rules_flag')) {
flush_rewrite_rules();
add_option('zerif_flush_rewrite_rules_flag', true);
}
}
开发者ID:EmreKarahan,项目名称:wordpress,代码行数:7,代码来源:functions.php
示例12: services_post_type
function services_post_type()
{
$labels = array('name' => _x('Services', 'post type services'), 'singular_name' => _x('Service', 'post type singular services'), 'add_new' => _x('Add new service', 'services'), 'add_new_item' => __('Add new services'), 'edit_item' => __('Edit service'), 'new_item' => __('New service'), 'view_item' => __('View service'), 'search_items' => __('Search services'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Services');
$args = array('labels' => $labels, 'public' => true, 'menu_icon' => 'dashicons-menu', 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('with_front' => false, 'slug' => 'services'), 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'show_in_nav_menus' => true, 'supports' => array('title', 'taxonomy', 'thumbnail', 'editor', 'excerpt'));
register_post_type('services', $args);
flush_rewrite_rules();
}
开发者ID:alldrops,项目名称:rio_v2,代码行数:7,代码来源:services.php
示例13: post_type
public function post_type()
{
$labels = array('name' => 'Recipes', 'singular_name' => 'Recipe', 'add_new' => 'Add New', 'add_new_item' => 'Add New Recipe', 'edit_item' => 'Edit Recipe', 'new_item' => 'New Recipe', 'all_items' => 'All Recipes', 'view_item' => 'View Recipe', 'search_items' => 'Search Recipes', 'not_found' => 'No recipes found', 'not_found_in_trash' => 'No recipes found in Trash', 'parent_item_colon' => '', 'menu_name' => 'Recipes');
$args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => false, 'show_in_menu' => false, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('tags', 'comments'));
register_post_type($this->get_post_type_name(), $args);
flush_rewrite_rules();
}
开发者ID:ryanto,项目名称:RecipeCan-Recipes,代码行数:7,代码来源:setup.php
示例14: on_activation
public function on_activation()
{
# First, we add the custom post type.
$this->register();
# Reset Apache rewrites to accommodate our new post type.
flush_rewrite_rules();
}
开发者ID:Blackbaud-SteveBrush,项目名称:blackbaud-wp-plugins,代码行数:7,代码来源:CustomPostType.php
示例15: flush_rewrites
public function flush_rewrites()
{
//defines the post type so the rules can be flushed.
$this->register_pins();
//and flush the rules.
flush_rewrite_rules();
}
开发者ID:rwrobe,项目名称:restful_maps,代码行数:7,代码来源:Pins.php
示例16: fac_sliders_init
function fac_sliders_init()
{
$labels = array('name' => __('Sliders', 'fac'), 'singular_name' => __('Slider', 'fac'), 'add_new' => __('Add New', 'fac'), 'add_new_item' => __('Add New Slider', 'fac'), 'edit_item' => __('Edit Slider', 'fac'), 'new_item' => __('New Slider', 'fac'), 'all_items' => __('Sliders', 'fac'), 'view_item' => __('View Slider', 'fac'), 'search_items' => __('Search Slider', 'fac'), 'not_found' => __('No Sliders Found', 'fac'), 'not_found_in_trash' => __('No Sliders Found in Trash', 'fac'), 'parent_item_colon' => '', 'menu_name' => __('Slider', 'fac'));
$args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => 'fac', 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => array('slug' => _x('fac-sliders', 'URL slug'), 'with_front' => false), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'menu_position' => 3, 'supports' => array('title'));
register_post_type('fac-sliders', $args);
flush_rewrite_rules();
}
开发者ID:thomashibbard,项目名称:aloha-poke,代码行数:7,代码来源:sliders-post-type.php
示例17: v13_upgrades
/**
* Perform database upgrades for version 1.3
*
* @access private
* @since 1.3
*/
private function v13_upgrades()
{
@affiliate_wp()->creatives->create_table();
// Clear rewrite rules
flush_rewrite_rules();
$this->upgraded = true;
}
开发者ID:kjohnson,项目名称:AffiliateWP,代码行数:13,代码来源:class-upgrades.php
示例18: vansSkateboarding_install
function vansSkateboarding_install()
{
// Trigger our function that registers the custom post type
vansSkateboarding_setup_post_types();
// Clear the permalinks after the post type has been registered
flush_rewrite_rules();
}
开发者ID:basheera,项目名称:plugins,代码行数:7,代码来源:dt-VansSkateboarding.php
示例19: be_create_kudos_cpt
function be_create_kudos_cpt()
{
$labels = array('name' => _x('Kudos', 'post type general name', 'be-kudos'), 'singular_name' => _x('Kudos', 'post type singular name', 'be-kudos'), 'menu_name' => _x('Kudos', 'admin menu', 'be-kudos'), 'name_admin_bar' => _x('Kudos', 'add new on admin bar', 'be-kudos'), 'add_new' => _x('Add New', 'kudo', 'be-kudos'), 'add_new_item' => __('Add New Kudos', 'be-kudos'), 'new_item' => __('New Kudos', 'be-kudos'), 'edit_item' => __('Edit Kudos', 'be-kudos'), 'view_item' => __('View Kudos', 'be-kudos'), 'all_items' => __('All Kudos', 'be-kudos'), 'search_items' => __('Search Kudos', 'be-kudos'), 'parent_item_colon' => __('Parent Kudos:', 'be-kudos'), 'not_found' => __('No kudos found.', 'be-kudos'), 'not_found_in_trash' => __('No kudos found in Trash.', 'be-kudos'));
$args = array('labels' => $labels, 'description' => __('Description.', 'be-kudos'), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'query_var' => true, 'rewrite' => array('slug' => 'kudos'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 5, 'menu_icon' => 'dashicons-heart', 'can_export' => true, 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'));
register_post_type('kudos', $args);
flush_rewrite_rules();
}
开发者ID:iamlisaross,项目名称:kudos,代码行数:7,代码来源:kudos.php
示例20: init
/**
* Called on activation. Calls necessary methods, and adds
* a flag in the database that ATCF has been installed.
*
* @since Astoundify Crowdfunding 1.6
*
* @return void
*/
public static function init()
{
flush_rewrite_rules();
update_option('atcf_installed', true);
self::roles();
self::cron();
}
开发者ID:unclebrain,项目名称:appthemer-crowdfunding,代码行数:15,代码来源:class-install.php
注:本文中的flush_rewrite_rules函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论