• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_rest_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: load_scripts

 function load_scripts()
 {
     wp_enqueue_script('admin-app', JS_APP_URL . 'build/js/admin-app-scripts.js', array('jquery'), PLUGIN_VERSION, false);
     wp_enqueue_script('react-components', JS_APP_URL . 'build/js/all-components.js', array('admin-app'), PLUGIN_VERSION, true);
     wp_enqueue_style('admin-app-styles', JS_APP_URL . 'build/css/styles.css', array(), PLUGIN_VERSION, 'all');
     wp_localize_script('admin-app', 'admin_app_local', array('api_url' => get_rest_url(), 'template_directory' => JS_APP_URL . 'templates', 'nonce' => wp_create_nonce('wp_rest')));
 }
开发者ID:WordPress-Admin-JavaScript-Boilerplate,项目名称:ReactJS-Boilerplate,代码行数:7,代码来源:admin_js.php


示例2: json_api_client_js

/**
 * Plugin Name: WP-API Client JS
 */
function json_api_client_js()
{
    $scripts = wp_scripts();
    $src = plugins_url('build/js/wp-api.js', __FILE__);
    if (isset($scripts->registered['wp-api'])) {
        $scripts->registered['wp-api']->src = $src;
    } else {
        wp_register_script('wp-api', $src, array('jquery', 'underscore', 'backbone'), '1.0', true);
    }
    /**
     * @var \WP_REST_Server $wp_rest_server
     */
    global $wp_rest_server;
    if (empty($wp_rest_server)) {
        /** This filter is documented in wp-includes/rest-api.php */
        $wp_rest_server_class = apply_filters('wp_rest_server_class', 'WP_REST_Server');
        $wp_rest_server = new $wp_rest_server_class();
        /** This filter is documented in wp-includes/rest-api.php */
        do_action('rest_api_init', $wp_rest_server);
    }
    $schema_request = new WP_REST_Request('GET', '/wp/v2');
    $schema_response = $wp_rest_server->dispatch($schema_request);
    $schema = null;
    if (!$schema_response->is_error()) {
        $schema = $schema_response->get_data();
    }
    $settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/', 'schema' => $schema);
    wp_localize_script('wp-api', 'wpApiSettings', $settings);
}
开发者ID:vickoman,项目名称:client-js,代码行数:32,代码来源:client-js.php


示例3: rest_register_scripts

 /**
  * Registers REST API JavaScript helpers.
  *
  * @since 4.4.0
  *
  * @see wp_register_scripts()
  */
 function rest_register_scripts()
 {
     // Use minified scripts if SCRIPT_DEBUG is not on.
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_register_script('wp-api', plugins_url('wp-api' . $suffix . '.js', __FILE__), array('jquery', 'backbone', 'underscore'), '1.2', true);
     $settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/');
     wp_localize_script('wp-api', 'wpApiSettings', $settings);
 }
开发者ID:xeiter,项目名称:timeplannr,代码行数:15,代码来源:extras.php


示例4: register_scripts

 /**
  * Register assets
  */
 public final function register_scripts()
 {
     // JS Cookie
     wp_register_script('js-cookie', _2ch_plugin_dir_url('/dist/js/js.cookie.js'), array(), '2.1.0', true);
     // Google reCAPTCHA
     wp_register_script('recaptcha', 'https://www.google.com/recaptcha/api.js?render=explicit&onload=nichanCallback', array(), null, false);
     // Form helper
     wp_register_script('2ch-form', _2ch_plugin_dir_url('/dist/js/2ch.js'), array('jquery-form', 'js-cookie', 'recaptcha'), PLUGIN_2CH_VERSION, true);
     wp_localize_script('2ch-form', 'NichanVars', array('root' => get_rest_url(), 'nonce' => wp_create_nonce('wp_rest'), 'callback' => false, 'message' => __('Comment has been posted and waiting form moderation.', '2ch')));
 }
开发者ID:hametuha,项目名称:2ch,代码行数:13,代码来源:ApiBase.php


示例5: rest_output_link_header

/**
 * Send a Link header for the API.
 */
function rest_output_link_header()
{
    if (headers_sent()) {
        return;
    }
    $api_root = get_rest_url();
    if (empty($api_root)) {
        return;
    }
    header('Link: <' . esc_url_raw($api_root) . '>; rel="https://github.com/WP-API/WP-API"', false);
}
开发者ID:nathansh,项目名称:gifzone,代码行数:14,代码来源:extras.php


示例6: enqueue

 /**
  * Enqueue scripts and styles - only called when builder is active.
  * @return void
  */
 function enqueue()
 {
     if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()) {
         // Enqueue Stylesheets
         wp_enqueue_style('fl-template-browser', plugins_url('/css/template-browser.css', dirname(__FILE__)), array('open-sans'));
         // Enqueue Scripts
         wp_enqueue_script('fl-template-browser', plugins_url('/js/min/template-browser-min.js', dirname(__FILE__)), array('backbone', 'wp-util'));
         $data = array('collections' => BRJ_TemplateCollection::get_collections(), 'libraries' => array_values(BRJ_TemplateLibrary::get_libraries()), 'root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'));
         wp_localize_script('fl-template-browser', 'BRJ_StoreInitialData', $data);
     }
 }
开发者ID:brentjett,项目名称:brj-template-browser,代码行数:15,代码来源:class-fl-builder-template-browser.php


示例7: json_api_client_js

/**
 * Plugin Name: WP-API Client JS
 */
function json_api_client_js()
{
    /**
     * Check if WP API functionality exists. Not using is_plugin_active in prepartion for
     */
    if (!function_exists('rest_get_url_prefix')) {
        return;
    }
    wp_enqueue_script('wp-api', plugins_url('wp-api.js', __FILE__), array('jquery', 'underscore', 'backbone'), '1.0', true);
    $settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'));
    wp_localize_script('wp-api', 'WP_API_Settings', $settings);
}
开发者ID:okofish,项目名称:client-js,代码行数:15,代码来源:client-js.php


示例8: get_items

 /**
  * Get menu locations.
  *
  * @since 1.2.0
  * @param  $request
  * @return array All registered menus locations
  */
 public function get_items($request)
 {
     $rest_url = get_rest_url() . $this->namespace . '/' . $this->base;
     $locations = get_nav_menu_locations();
     $registered_menus = get_registered_nav_menus();
     $rest_menus = array();
     if ($locations && $registered_menus) {
         foreach ($registered_menus as $slug => $label) {
             $rest_menus[] = array($slug => array('ID' => $locations[$slug], 'label' => $label, 'meta' => array('links' => array('collection' => $rest_url, 'self' => $rest_url . '/' . $slug)), 'tree' => $this->get_menu_tree($slug)));
         }
     }
     return $rest_menus;
 }
开发者ID:V8CH,项目名称:wp-rest-ext,代码行数:20,代码来源:class-v8ch-wp-rest-menu-trees-controller.php


示例9: fed_scripts

 function fed_scripts()
 {
     wp_enqueue_style('wp-stripe-fed-styles', WP_STRIPE_URL . '/build/front-end/css/wp-stripe-fed-styles.css', array(), WP_STRIPE_VERSION, 'all');
     wp_enqueue_script('wp-stripe-fed-scripts', WP_STRIPE_URL . '/build/front-end/js/stripe-wp-fed-scripts.js', array('jquery'), WP_STRIPE_VERSION, false);
     $local_object = array('api_url' => get_rest_url(), 'template_directory' => WP_STRIPE_URL . 'templates', 'nonce' => wp_create_nonce('wp_rest'));
     if (get_option('stripe_wp_confirmation_type', false) == 'page' && get_option('stripe_wp_confirmation_page', false)) {
         $local_object['confirmation'] = array('type' => 'page', 'page' => get_permalink(get_option('stripe_wp_confirmation_page', false)));
     }
     if (get_option('stripe_wp_confirmation_type', false) == 'message' && get_option('stripe_wp_confirmation_message', false)) {
         $local_object['confirmation'] = array('type' => 'message', 'message' => get_permalink(get_option('stripe_wp_confirmation_message', false)));
     }
     wp_localize_script('wp-stripe-fed-scripts', 'stripe_wp_local', $local_object);
 }
开发者ID:royboy789,项目名称:Stripe-for-WordPress,代码行数:13,代码来源:wp-stripe-scripts.php


示例10: test_get_items

 /**
  * Test that list endpoint returns expected format
  */
 public function test_get_items()
 {
     $ev = Utils::create_test_event();
     // Don't test internal events with this test
     $internal_events = array('a8c_cron_control_force_publish_missed_schedules', 'a8c_cron_control_confirm_scheduled_posts', 'a8c_cron_control_clean_legacy_data', 'a8c_cron_control_purge_completed_events');
     foreach ($internal_events as $internal_event) {
         wp_clear_scheduled_hook($internal_event);
     }
     $request = new \WP_REST_Request('POST', '/' . \Automattic\WP\Cron_Control\REST_API::API_NAMESPACE . '/' . \Automattic\WP\Cron_Control\REST_API::ENDPOINT_LIST);
     $request->set_body(wp_json_encode(array('secret' => \WP_CRON_CONTROL_SECRET)));
     $request->set_header('content-type', 'application/json');
     $response = $this->server->dispatch($request);
     $data = $response->get_data();
     $this->assertResponseStatus(200, $response);
     $this->assertArrayHasKey('events', $data);
     $this->assertArrayHasKey('endpoint', $data);
     $this->assertResponseData(array('events' => array(array('timestamp' => $ev['timestamp'], 'action' => md5($ev['action']), 'instance' => md5(maybe_serialize($ev['args'])))), 'endpoint' => get_rest_url(null, \Automattic\WP\Cron_Control\REST_API::API_NAMESPACE . '/' . \Automattic\WP\Cron_Control\REST_API::ENDPOINT_RUN)), $response);
 }
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:21,代码来源:test-rest-api.php


示例11: print_settings

    /**
     * Print the JavaScript settings.
     */
    public function print_settings()
    {
        ?>
			<script type="text/javascript">
				window.wp = window.wp || {};
				window.wp.react = window.wp.react || {};
				window.wp.react.settings = {
					emoji_url: '<?php 
        echo REACT_URL . '/static/emoji.json';
        ?>
',
					endpoint:  '<?php 
        echo get_rest_url(null, $this->api->namespace . '/' . $this->api->rest_base);
        ?>
'
				}
			</script>
		<?php 
    }
开发者ID:pento,项目名称:react,代码行数:22,代码来源:class-react.php


示例12: get_events

 /**
  * List events pending for the current period
  */
 public function get_events()
 {
     $events = get_option('cron');
     // That was easy
     if (!is_array($events) || empty($events)) {
         return array('events' => null);
     }
     // Simplify array format for further processing
     $events = collapse_events_array($events);
     // Select only those events to run in the next sixty seconds
     // Will include missed events as well
     $current_events = $internal_events = array();
     $current_window = strtotime(sprintf('+%d seconds', JOB_QUEUE_WINDOW_IN_SECONDS));
     foreach ($events as $event) {
         // Skip events whose time hasn't come
         if ($event['timestamp'] > $current_window) {
             continue;
         }
         // Skip events that don't have any callbacks hooked to their actions, unless their execution is requested
         if (!$this->action_has_callback_or_should_run_anyway($event)) {
             continue;
         }
         // Necessary data to identify an individual event
         // `$event['action']` is hashed to avoid information disclosure
         // Core hashes `$event['instance']` for us
         $event_data_public = array('timestamp' => $event['timestamp'], 'action' => md5($event['action']), 'instance' => $event['instance']);
         // Queue internal events separately to avoid them being blocked
         if (is_internal_event($event['action'])) {
             $internal_events[] = $event_data_public;
         } else {
             $current_events[] = $event_data_public;
         }
     }
     // Limit batch size to avoid resource exhaustion
     if (count($current_events) > JOB_QUEUE_SIZE) {
         $current_events = $this->reduce_queue($current_events);
     }
     // Combine with Internal Events and return necessary data to process the event queue
     return array('events' => array_merge($current_events, $internal_events), 'endpoint' => get_rest_url(null, REST_API::API_NAMESPACE . '/' . REST_API::ENDPOINT_RUN));
 }
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:43,代码来源:class-events.php


示例13: wp_enqueue_scripts

 function wp_enqueue_scripts()
 {
     global $post;
     $rest_server = rest_get_server();
     if ($this->has_fee()) {
         wp_enqueue_style('wp-core-ui', $this->url('/css/wp-core-ui.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('wp-core-ui-colors', $this->url('/css/wp-core-ui-colors.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('wp-auth-check');
         wp_enqueue_script('wp-auth-check');
         wp_enqueue_script('fee-tinymce', $this->url('/vendor/tinymce.js'), array(), self::TINYMCE_VERSION, true);
         wp_enqueue_script('fee-tinymce-image', $this->url('/js/tinymce.image.js'), array('fee-tinymce'), self::VERSION, true);
         wp_enqueue_script('fee-tinymce-theme', $this->url('/js/tinymce.theme.js'), array('fee-tinymce'), self::VERSION, true);
         foreach (array('lists', 'paste', 'wordpress', 'wplink', 'wptextpattern', 'wpview') as $plugin) {
             wp_enqueue_script('fee-' . $plugin, $this->url('/vendor/' . $plugin . '.js'), array('fee-tinymce'), self::VERSION, true);
         }
         $tinymce_plugins = array('wordpress', 'feeImage', 'wptextpattern', 'wplink', 'wpview', 'paste', 'lists');
         $tinymce_toolbar = array('bold', 'italic', 'strikethrough', 'link');
         $tinymce = array('selector' => '.fee-content', 'plugins' => implode(' ', array_unique(apply_filters('fee_tinymce_plugins', $tinymce_plugins))), 'toolbar' => apply_filters('fee_tinymce_toolbar', $tinymce_toolbar), 'theme' => 'fee', 'inline' => true, 'relative_urls' => false, 'convert_urls' => false, 'browser_spellcheck' => true, 'placeholder' => apply_filters('fee_content_placeholder', __('Just write…')), 'wpeditimage_html5_captions' => current_theme_supports('html5', 'caption'), 'end_container_on_empty_block' => true);
         $request = new WP_REST_Request('GET', '/wp/v2/' . ($post->post_type === 'page' ? 'pages' : 'posts') . '/' . $post->ID);
         $request->set_query_params(array('context' => 'edit'));
         $result = $rest_server->dispatch($request);
         wp_enqueue_script('fee', $this->url('/js/fee.js'), array('fee-tinymce', 'wp-util', 'heartbeat', 'editor', 'wp-api', 'media-views'), self::VERSION, true);
         wp_localize_script('fee', 'feeData', array('tinymce' => apply_filters('fee_tinymce_config', $tinymce), 'post' => $result->get_data(), 'lock' => !wp_check_post_lock($post->ID) ? implode(':', wp_set_post_lock($post->ID)) : false, 'titlePlaceholder' => apply_filters('enter_title_here', __('Enter title here'), $post), 'editURL' => get_edit_post_link()));
         $request = new WP_REST_Request('GET', '/wp/v2');
         $result = $rest_server->dispatch($request);
         wp_localize_script('wp-api', 'wpApiSettings', array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/', 'schema' => $result->get_data(), 'cacheSchema' => true));
         wp_enqueue_media(array('post' => $post));
         wp_deregister_script('mce-view');
         wp_enqueue_script('mce-view', $this->url('/vendor/mce-view.js'), array('shortcode', 'jquery', 'media-views', 'media-audiovideo'), self::VERSION, true);
         wp_enqueue_script('mce-view-register', $this->url('/js/mce-view-register.js'), array('mce-view', 'fee'), self::VERSION, true);
         wp_localize_script('mce-view-register', 'mce_view_register', array('post_id' => $post->ID));
         wp_enqueue_style('tinymce-core', $this->url('/css/tinymce.core.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('tinymce-view', $this->url('/css/tinymce.view.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('fee', $this->url('/css/fee.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('dashicons');
     }
     if (current_user_can('edit_posts')) {
         if (is_singular()) {
             require_once ABSPATH . '/wp-admin/includes/post.php';
             $user_id = wp_check_post_lock($post->ID);
             $user = get_userdata($user_id);
         }
         wp_enqueue_script('fee-adminbar', $this->url('/js/fee-adminbar.js'), array('wp-util', 'wp-api'), self::VERSION, true);
         wp_localize_script('fee-adminbar', 'fee_adminbar', array('lock' => is_singular() && $user_id ? $user->display_name : false, 'supportedPostTypes' => $this->get_supported_post_types(), 'postNew' => admin_url('post-new.php'), 'nonce' => wp_create_nonce('fee-new')));
     }
 }
开发者ID:louis-ev,项目名称:wp-front-end-editor,代码行数:46,代码来源:class-fee.php


示例14: boot_preview_script

    /**
     * Boot script for Customizer preview.
     *
     * @action wp_head
     */
    public function boot_preview_script()
    {
        global $wp_customize;
        wp_print_scripts(array('customize-rest-resources-preview-manager'));
        $dirty_setting_values = array();
        foreach (array_keys($wp_customize->unsanitized_post_values()) as $setting_id) {
            if (!preg_match('#^rest_resource\\[#', $setting_id)) {
                continue;
            }
            $setting = $wp_customize->get_setting($setting_id);
            if ($setting) {
                $dirty_setting_values[$setting_id] = $setting->value();
            }
        }
        $args = array('previewedTheme' => $wp_customize->get_stylesheet(), 'previewNonce' => wp_create_nonce('preview-customize_' . $wp_customize->get_stylesheet()), 'restApiRoot' => get_rest_url(), 'initialDirtySettingValues' => $dirty_setting_values);
        ?>
		<script>
		/* global CustomizeRestResources */
		CustomizeRestResources.manager = new CustomizeRestResources.RestResourcesPreviewManager( <?php 
        echo wp_json_encode($args);
        ?>
 );
		</script>
		<?php 
    }
开发者ID:chandra-patel,项目名称:wp-customize-rest-resources,代码行数:30,代码来源:class-plugin.php


示例15: anadama_scripts

/**
 * Enqueue scripts and styles.
 */
function anadama_scripts()
{
    wp_enqueue_style('anadama-style', get_stylesheet_uri());
    wp_enqueue_script('anadama-react', get_template_directory_uri() . '/js/app.js', array('jquery'), ANADAMA_VERSION, true);
    wp_localize_script('anadama-react', 'AnadamaSettings', array('nonce' => wp_create_nonce('wp_rest'), 'user' => get_current_user_id(), 'title' => get_bloginfo('name', 'display'), 'URL' => array('root' => esc_url_raw(get_rest_url(null, '/wp/v2')), 'menuRoot' => esc_url_raw(get_rest_url(null, '/wp-api-menus/v2')), 'base' => esc_url_raw(home_url()))));
}
开发者ID:deviodigital,项目名称:Anadama-React,代码行数:9,代码来源:functions.php


示例16: foxhound_scripts

/**
 * Enqueue scripts and styles.
 */
function foxhound_scripts()
{
    wp_enqueue_style('foxhound-style', get_template_directory_uri() . '/build/style.css');
    wp_enqueue_script(FOXHOUND_APP, get_template_directory_uri() . '/build/app.js', array('jquery'), FOXHOUND_VERSION, true);
    if (class_exists('Jetpack_Tiled_Gallery')) {
        Jetpack_Tiled_Gallery::default_scripts_and_styles();
    }
    $url = trailingslashit(home_url());
    $path = trailingslashit(parse_url($url, PHP_URL_PATH));
    $front_page_slug = false;
    $blog_page_slug = false;
    if ('posts' !== get_option('show_on_front')) {
        $front_page_id = get_option('page_on_front');
        $front_page = get_post($front_page_id);
        if ($front_page->post_name) {
            $front_page_slug = $front_page->post_name;
        }
        $blog_page_id = get_option('page_for_posts');
        $blog_page = get_post($blog_page_id);
        if ($blog_page->post_name) {
            $blog_page_slug = $blog_page->post_name;
        }
    }
    wp_localize_script(FOXHOUND_APP, 'SiteSettings', array('endpoint' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest')));
    $user_id = get_current_user_id();
    $user = get_userdata($user_id);
    wp_localize_script(FOXHOUND_APP, 'FoxhoundSettings', array('user' => get_current_user_id(), 'userDisplay' => $user ? $user->display_name : '', 'frontPage' => array('page' => $front_page_slug, 'blog' => $blog_page_slug), 'URL' => array('base' => esc_url_raw($url), 'path' => $path), 'meta' => array('title' => get_bloginfo('name', 'display'), 'description' => get_bloginfo('description', 'display'))));
}
开发者ID:ryelle,项目名称:Foxhound,代码行数:31,代码来源:functions.php


示例17: generate_default_content

 /**
  * generates the host-meta base array (and activate filter)
  *
  * @param array $host_meta
  * @return array
  */
 public static function generate_default_content($host_meta)
 {
     $host_meta = array();
     // add subject
     $host_meta['subject'] = site_url();
     // add feeds
     $host_meta['links'] = array(array('rel' => 'alternate', 'href' => get_bloginfo('atom_url'), 'type' => 'application/atom+xml'), array('rel' => 'alternate', 'href' => get_bloginfo('rss2_url'), 'type' => 'application/rss+xml'), array('rel' => 'alternate', 'href' => get_bloginfo('rdf_url'), 'type' => 'application/rdf+xml'));
     // RSD discovery link
     $host_meta['links'][] = array('rel' => 'EditURI', 'href' => esc_url(site_url('xmlrpc.php?rsd', 'rpc')), 'type' => 'application/rsd+xml');
     // add WordPress API
     if (function_exists('get_rest_url')) {
         $host_meta['links'][] = array('rel' => 'https://api.w.org/', 'href' => esc_url(get_rest_url()));
     }
     return $host_meta;
 }
开发者ID:pfefferle,项目名称:wordpress-host-meta,代码行数:21,代码来源:host-meta.php


示例18: rest_url

/**
 * Get URL to a REST endpoint.
 *
 * @param string $path   Optional. REST route. Default empty.
 * @param string $scheme Optional. Sanitization scheme. Default 'json'.
 * @return string Full URL to the endpoint.
 */
function rest_url($path = '', $scheme = 'json')
{
    return get_rest_url(null, $path, $scheme);
}
开发者ID:hypenotic,项目名称:ingenuity,代码行数:11,代码来源:plugin.php


示例19: lss_widget_output

 public function lss_widget_output($atts, $content = "")
 {
     $s = isset($_POST['LSSW_s']) ? $_POST['LSSW_s'] : NULL;
     $query = isset($_POST['LSSW_field_query']) ? $_POST['LSSW_field_query'] : NULL;
     wp_enqueue_script($this->plugin_name);
     wp_localize_script($this->plugin_name, 'LSSW_data', array('base' => get_rest_url(null, '/lsswidget/v1/'), 'dashboard' => Lss_Tools_Option::get_option('url'), 'search' => 'search/', 'signup' => 'signup/', 'keyword' => Lss_Tools_Option::get_option('keyword') ?: true, 'contact' => Lss_Tools_Option::get_option('contact') ?: true));
     ob_start();
     include plugin_dir_path(__FILE__) . 'partials/lss-tools-public-display.php';
     return ob_get_clean();
 }
开发者ID:jacobhenke,项目名称:lss-tools,代码行数:10,代码来源:class-lss-tools-public.php


示例20: page

        /**
         * Localizes the bootstrap, enqueues the script and styles for the help page
         */
        public function page()
        {
            $this->help_sections = array();
            $this->add_fieldset('health', _x('Health', 'This section displays the overall health of Connect for WooCommerce and the things it depends on', 'connectforwoocommerce'), $this->get_health_items());
            $this->add_fieldset('services', __('Services', 'connectforwoocommerce'), $this->get_services_items());
            $this->add_fieldset('debug', __('Debug', 'connectforwoocommerce'), $this->get_debug_items());
            $this->add_fieldset('support', __('Support', 'connectforwoocommerce'), $this->get_support_items());
            $root_view = 'wc-connect-admin-help';
            $admin_array = array('storeOptions' => $this->service_settings_store->get_store_options(), 'formSchema' => $this->get_form_schema(), 'formLayout' => $this->get_form_layout(), 'formData' => $this->get_form_data(), 'predefinedPackages' => array(), 'callbackURL' => get_rest_url(null, "/wc/v1/connect/self-help"), 'nonce' => wp_create_nonce('wp_rest'), 'rootView' => $root_view);
            wp_localize_script('wc_connect_admin', 'wcConnectData', $admin_array);
            wp_enqueue_script('wc_connect_admin');
            wp_enqueue_style('wc_connect_admin');
            ?>
				<h2>
					<?php 
            _e('Connect for WooCommerce Status', 'woocommerce');
            ?>
				</h2>
				<div class="wc-connect-admin-container" id="<?php 
            echo esc_attr($root_view);
            ?>
"></div>
			<?php 
        }
开发者ID:Automattic,项目名称:woocommerce-connect-client,代码行数:27,代码来源:class-wc-connect-help-view.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_result函数代码示例发布时间:2022-05-15
下一篇:
PHP get_response函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap