本文整理汇总了PHP中vc_get_param函数的典型用法代码示例。如果您正苦于以下问题:PHP vc_get_param函数的具体用法?PHP vc_get_param怎么用?PHP vc_get_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vc_get_param函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: vc_page_welcome_set_redirect
/**
* Set redirect transition on update or activation
* @since 4.5
*/
function vc_page_welcome_set_redirect()
{
if (!is_network_admin() && !vc_get_param('activate-multi')) {
/* nectar addition */
//set_transient( '_vc_page_welcome_redirect', 1, 30 );
/* nectar addition end */
}
}
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:12,代码来源:welcome-screen.php
示例2: addMenuPageHooks
public function addMenuPageHooks() {
if ( current_user_can( 'manage_options' ) ) {
add_action( 'admin_menu', array( &$this, 'addMenuPage' ) );
add_action( 'network_admin_menu', array( &$this, 'addMenuPage' ) );
if(vc_get_param('page') === 'vc_settings' || vc_post_param('action') === 'update') {
add_action( 'admin_init', array( $this, 'initAdmin' ) );
}
}
add_action( 'wp_ajax_wpb_remove_settings_notification_element_css_class', array( &$this, 'removeNotification' ) );
}
开发者ID:verbazend,项目名称:AWFA,代码行数:10,代码来源:class-vc-settings.php
示例3: setPost
/**
*
*/
function setPost()
{
global $post;
$this->post = get_post();
// fixes #1342 if no get/post params set
$this->post_id = vc_get_param('post_id');
if (vc_post_param('post_id')) {
$this->post_id = vc_post_param('post_id');
}
if ($this->post_id) {
$this->post = get_post($this->post_id);
}
do_action_ref_array('the_post', array(&$this->post));
$post = $this->post;
$this->post_id = $this->post->ID;
}
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:19,代码来源:class-vc-frontend-editor.php
示例4: setMode
/**
* Set VC mode.
*
* Mode depends on which page is requested by client from server and request parameters like vc_action.
*
* @since 4.2
* @access protected
* @return void
*/
protected function setMode()
{
if (is_admin()) {
if (vc_action() === 'vc_inline') {
$this->mode = 'admin_frontend_editor';
} elseif (vc_action() === 'vc_upgrade' || vc_get_param('action') === 'update-selected' && vc_get_param('plugins') === $this->pluginName()) {
$this->mode = 'admin_updater';
} elseif (isset($_GET['page']) && $_GET['page'] === $this->settings()->page()) {
$this->mode = 'admin_settings_page';
} else {
$this->mode = 'admin_page';
}
} else {
if (isset($_GET['vc_editable']) && $_GET['vc_editable'] === 'true') {
$this->mode = 'page_editable';
} else {
$this->mode = 'page';
}
}
}
开发者ID:nignjatov,项目名称:TaxiDev,代码行数:29,代码来源:js_composer.php
示例5: setMode
/**
* Set VC mode.
*
* Mode depends on which page is requested by client from server and request parameters like vc_action.
*
* @since 4.2
* @access protected
*
* @return void
*/
protected function setMode()
{
/**
* @todo: Create another system (When ajax rebuild).
* Use vc_action param to define mode.
* 1. admin_frontend_editor - set by editor or request param
* 2. admin_backend_editor - set by editor or request param
* 3. admin_frontend_editor_ajax - set by request param
* 4. admin_backend_editor_ajax - set by request param
* 5. admin_updater - by vc_action
* 6. page_editable - by vc_action
*/
if (is_admin()) {
if (vc_action() === 'vc_inline') {
$this->mode = 'admin_frontend_editor';
} elseif (vc_action() === 'vc_upgrade' || vc_get_param('action') === 'update-selected' && vc_get_param('plugins') === $this->pluginName()) {
$this->mode = 'admin_updater';
} elseif (isset($_GET['page']) && $_GET['page'] === $this->settings()->page()) {
$this->mode = 'admin_settings_page';
} else {
$this->mode = 'admin_page';
}
} else {
if (isset($_GET['vc_editable']) && $_GET['vc_editable'] === 'true') {
$this->mode = 'page_editable';
} else {
$this->mode = 'page';
}
}
}
开发者ID:nikintharan,项目名称:campaign,代码行数:40,代码来源:js_composer.php
示例6: __
}
$tabs = $new;
} else {
$tabs['vc-roles'] = __('Roles Manager', 'js_composer');
}
return $tabs;
}
add_filter('vc_settings_tabs', 'vc_settings_tabs_vc_roles');
function vc_settings_render_tab_vc_roles()
{
return 'pages/vc-settings/tab-vc-roles.php';
}
add_filter('vc_settings-render-tab-vc-roles', 'vc_settings_render_tab_vc_roles');
function vc_roles_settings_save()
{
if (check_admin_referer('vc_settings-roles-action', 'vc_nonce_field') && current_user_can('manage_options')) {
require_once vc_path_dir('SETTINGS_DIR', 'class-vc-roles.php');
$vc_roles = new Vc_Roles();
$data = $vc_roles->save(vc_request_param('vc_roles', array()));
echo json_encode($data);
die;
}
}
add_action('wp_ajax_vc_roles_settings_save', 'vc_roles_settings_save');
if ('vc-roles' == vc_get_param('page')) {
function vc_settings_render_tab_vc_roles_scripts()
{
wp_register_script('vc_settings-roles-tab-js', vc_asset_url('js/lib/vc-roles-tab.js'), array('jquery'), WPB_VC_VERSION, true);
}
add_action('admin_init', 'vc_settings_render_tab_vc_roles_scripts');
}
开发者ID:severnrescue,项目名称:web,代码行数:31,代码来源:page-role-manager.php
示例7: setMode
/**
* Set VC mode.
*
* Mode depends on which page is requested by client from server and request parameters like vc_action.
*
* @since 4.2
* @access protected
*
* @return void
*/
protected function setMode() {
/**
* TODO: Create another system (When ajax rebuild).
* Use vc_action param to define mode.
* 1. admin_frontend_editor - set by editor or request param
* 2. admin_backend_editor - set by editor or request param
* 3. admin_frontend_editor_ajax - set by request param
* 4. admin_backend_editor_ajax - set by request param
* 5. admin_updater - by vc_action
* 6. page_editable - by vc_action
*/
if ( is_admin() ) {
if ( vc_action() === 'vc_inline' && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
$this->mode = 'admin_frontend_editor';
} elseif ( ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) && (
vc_action() === 'vc_upgrade' ||
( vc_get_param( 'action' ) === 'update-selected' && vc_get_param( 'plugins' ) === $this->pluginName() )
) ) {
$this->mode = 'admin_updater';
} elseif ( current_user_can( 'manage_options' ) && isset( $_GET['page'] ) && $_GET['page'] === $this->settings()->page() ) {
$this->mode = 'admin_settings_page';
} else {
$this->mode = 'admin_page';
}
} else {
if ( vc_verify_admin_nonce() && current_user_can( 'edit_post', (int) vc_request_param( 'vc_post_id' ) ) && isset( $_GET['vc_editable'] ) && 'true' === $_GET['vc_editable'] ) {
$this->mode = 'page_editable';
} else {
$this->mode = 'page';
}
}
}
开发者ID:nishpatel,项目名称:cotswold,代码行数:42,代码来源:js_composer.php
示例8: vc_is_frontend_ajax
/**
* @since 4.2
* @return bool
*/
function vc_is_frontend_ajax()
{
return 'true' === vc_post_param('vc_inline') || vc_get_param('vc_inline');
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:8,代码来源:helpers_factory.php
示例9: vc_path_dir
/** @var $editor Vc_Backend_Editor */
?>
<style>
#wpb_visual_composer {
display: none;
}
</style>
<div class="metabox-composer-content">
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"></div>
<?php
require vc_path_dir('TEMPLATES_DIR', 'editors/partials/vc_welcome_block.tpl.php');
?>
</div>
<?php
$wpb_vc_status = apply_filters('wpb_vc_js_status_filter', vc_get_param('wpb_vc_js_status', get_post_meta($post->ID, '_wpb_vc_js_status', true)));
if ('' === $wpb_vc_status || !isset($wpb_vc_status)) {
$wpb_vc_status = vc_user_access()->part('backend_editor')->checkState('default')->get() ? 'true' : 'false';
}
?>
<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="<?php
echo esc_attr($wpb_vc_status);
?>
"/>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading"
value="<?php
esc_attr_e('Loading, please wait...', 'js_composer');
?>
"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row"
开发者ID:k2jysy,项目名称:wedev,代码行数:31,代码来源:backend_editor.tpl.php
示例10: vc_page_welcome_set_redirect
/**
* Set redirect transition on update or activation
* @since 4.5
*/
function vc_page_welcome_set_redirect()
{
if (!is_network_admin() && !vc_get_param('activate-multi')) {
set_transient('_vc_page_welcome_redirect', 1, 30);
}
}
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:10,代码来源:welcome-screen.php
示例11: vc_page_settings_render
function vc_page_settings_render()
{
$page = vc_get_param('page');
do_action('vc_page_settings_render-' . $page);
vc_settings()->renderTab($page);
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:6,代码来源:settings-tabs.php
示例12: die
<?php
if (!defined('ABSPATH')) {
die('-1');
}
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
if (vc_user_access()->wpAny('manage_options')->part('settings')->can('vc-automapper-tab')->get()) {
vc_automapper()->addAjaxActions();
}
}
/**
* Returns automapper template.
*
* @since 4.5
* @return string
*/
function vc_page_automapper_build()
{
return 'pages/vc-settings/vc-automapper.php';
}
// TODO: move to separate file in autoload
add_filter('vc_settings-render-tab-vc-automapper', 'vc_page_automapper_build');
is_admin() && ('vc_automapper' === vc_request_param('action') || 'vc-automapper' === vc_get_param('page')) && add_action('admin_init', 'vc_automapper_init');
开发者ID:mazykin46,项目名称:portfolio,代码行数:28,代码来源:automapper.php
示例13: output
public function output($post = null)
{
$output = $this->getNavBar()->getElementsModal();
$output .= $this->getNavBar()->output();
$output .= '
<div class="metabox-composer-content">
<div class="vc_loading_block" style="display: none;">
<img src="' . get_site_url() . '/wp-admin/images/wpspin_light.gif" /> ' . __("Loading, please wait...", "js_composer") . '
</div>
<div id="visual_composer_content" class="wpb_main_sortable main_wrapper"></div>
<div id="wpb-empty-blocks">
<h2>' . __("No content yet! You should add some...", "js_composer") . '</h2>
<table class="helper-block">
<tr>
<td><span>1</span></td>
<td><p> ' . __("This is a visual preview of your page. Currently, you don't have any content elements. Click or drag the button <a href='#' class='add-element-to-layout'><i class='icon'></i> Add element</a> on the top to add content elements on your page. Alternatively add <a href='#' class='add-text-block-to-content' parent-container='#visual_composer_content'><i class='icon'></i> Text block</a> with single click.", "js_composer") . '</p></td>
</tr>
</table>
<table class="helper-block">
<tr>
<td><span>2</span></td><td><p class="one-line"> ' . __("Click the pencil icon on the content elements to change their properties.", "js_composer") . '</p></td>
</tr>
<tr>
<td colspan="2">
<div class="edit-picture"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="container-helper-block" style="display: none;">' . $this->getContainerHelper() . '</div>';
?>
<script type="text/javascript">
var vc_user_mapper = <?php
echo json_encode(WPBMap::getUserShortCodes());
?>
,
vc_mapper = <?php
echo json_encode(WPBMap::getShortCodes());
?>
,
vc_frontend_enabled = <?php
echo vc_enabled_frontend() ? 'true' : 'false';
?>
;
</script>
<?php
$wpb_vc_status = apply_filters('wpb_vc_js_status_filter', vc_get_param('wpb_vc_js_status', get_post_meta($post->ID, '_wpb_vc_js_status', true)));
$wpb_post_custom_css = get_post_meta($post->ID, '_wpb_post_custom_css', true);
if ($wpb_vc_status == "" || !isset($wpb_vc_status)) {
$wpb_vc_status = 'false';
}
$output .= '<input type="hidden" id="wpb_custom_post_css_field" name="wpb_vc_post_custom_css" value="' . htmlspecialchars($wpb_post_custom_css) . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="' . $wpb_vc_status . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading" value="' . __("Loading, please wait...", "js_composer") . '" />';
$output .= '<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row" value="' . __("Crunching...", "js_composer") . '" />';
$output .= '<input type="hidden" id="wpb_vc_js_interface_version" name="wpb_vc_js_interface_version" value="' . vc_get_initerface_version() . '" />';
echo $output;
require_once vc_path_dir('TEMPLATES_DIR', 'backend_editor/templates.php');
do_action('vc_backend_editor_render');
}
开发者ID:Vatia13,项目名称:tofido,代码行数:62,代码来源:layouts.php
示例14: vcFrontendEditorRender
/**
* @since 4.3
*/
public function vcFrontendEditorRender()
{
global $q_config;
$output = '';
$q_lang = vc_get_param('qlang');
if (!is_string($q_lang)) {
$q_lang = $q_config['language'];
}
$output .= '<input type="hidden" id="vc_vendor_qtranslate_postcontent" value="' . esc_attr(vc_frontend_editor()->post()->post_content) . '" data-lang="' . $q_lang . '"/>';
$output .= '<input type="hidden" id="vc_vendor_qtranslate_posttitle" value="' . esc_attr(vc_frontend_editor()->post()->post_title) . '" data-lang="' . $q_lang . '"/>';
echo $output;
}
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:15,代码来源:class-vc-vendor-qtranslate.php
示例15: preUpgradeFilter
/**
* Get link to newest VC
*
* @param $reply
* @param $package
* @param $updater
*
* @return mixed|string|WP_Error
*/
public function preUpgradeFilter($reply, $package, $updater)
{
$condition1 = isset($updater->skin->plugin) && $updater->skin->plugin === vc_plugin_name();
$condition2 = isset($updater->skin->plugin_info) && $updater->skin->plugin_info['Name'] === $this->title;
if (!$condition1 && !$condition2) {
return $reply;
}
$res = $updater->fs_connect(array(WP_CONTENT_DIR));
if (!$res) {
return new WP_Error('no_credentials', __("Error! Can't connect to filesystem", 'js_composer'));
}
$license_key = vc_license()->getLicenseKey();
if (!$license_key || !vc_license()->isActivated()) {
if (vc_is_as_theme() && vc_get_param('action') !== 'update-selected') {
return false;
}
$url = esc_url(vc_is_network_plugin() ? network_admin_url('admin.php?page=vc-updater') : admin_url('admin.php?page=vc-updater'));
return new WP_Error('no_credentials', __('To receive automatic updates license activation is required. Please visit <a href="' . $url . '' . '" target="_blank">Settings</a> to activate your Visual Composer.', 'js_composer') . ' ' . sprintf(' <a href="http://go.wpbakery.com/faq-update-in-theme" target="_blank">%s</a>', __('Got Visual Composer in theme?', 'js_composer')));
}
$updater->strings['downloading_package_url'] = __('Getting download link...', 'js_composer');
$updater->skin->feedback('downloading_package_url');
$response = $this->getDownloadUrl($license_key);
if (!$response) {
return new WP_Error('no_credentials', __('Download link could not be retrieved', 'js_composer'));
}
if (!$response['status']) {
return new WP_Error('no_credentials', $response['error']);
}
$updater->strings['downloading_package'] = __('Downloading package...', 'js_composer');
$updater->skin->feedback('downloading_package');
$downloaded_archive = download_url($response['url']);
if (is_wp_error($downloaded_archive)) {
return $downloaded_archive;
}
$plugin_directory_name = 'js_composer';
// WP will use same name for plugin directory as archive name, so we have to rename it
if (basename($downloaded_archive, '.zip') !== $plugin_directory_name) {
$new_archive_name = dirname($downloaded_archive) . '/' . $plugin_directory_name . '.zip';
rename($downloaded_archive, $new_archive_name);
$downloaded_archive = $new_archive_name;
}
return $downloaded_archive;
}
开发者ID:ksan5835,项目名称:maadithottam,代码行数:52,代码来源:class-vc-updater.php
示例16: buildEditForm
function buildEditForm() {
$element = vc_get_param( 'element' );
$shortCode = stripslashes( vc_get_param( 'shortcode' ) );
WpbakeryShortcodeParams::setEnqueue( true );
$this->removeShortCode( $element );
$settings = WPBMap::getShortCode( $element );
new WPBakeryShortCode_Settings( $settings );
return do_shortcode( $shortCode );
}
开发者ID:verbazend,项目名称:AWFA,代码行数:9,代码来源:class-vc-frontend-editor.php
示例17: vc_automapper_init
<?php
/**
* Build and enqueue js/css for automapper settings tab.
* @since 4.5
*/
function vc_automapper_init()
{
vc_automapper()->build();
}
/**
* Returns automapper template.
*
* @since 4.5
* @return string
*/
function vc_page_automapper_build()
{
return 'pages/vc-settings/vc-automapper.php';
}
// TODO: move to separate file in autoload
add_filter('vc_settings-render-tab-vc-automapper', 'vc_page_automapper_build');
is_admin() && 'vc-automapper' === vc_get_param('page') && add_action('admin_enqueue_scripts', 'vc_automapper_init');
开发者ID:evanbuss,项目名称:wordpress,代码行数:23,代码来源:automapper.php
示例18: setMode
/**
* Set VC mode.
*
* Mode depends on which page is requested by client from server and request parameters like vc_action.
*
* @since 4.2
* @access protected
*
* @return void
*/
protected function setMode()
{
/**
* TODO: Create another system (When ajax rebuild).
* Use vc_action param to define mode.
* 1. admin_frontend_editor - set by editor or request param
* 2. admin_backend_editor - set by editor or request param
* 3. admin_frontend_editor_ajax - set by request param
* 4. admin_backend_editor_ajax - set by request param
* 5. admin_updater - by vc_action
* 6. page_editable - by vc_action
*/
if (is_admin()) {
if ('vc_inline' === vc_action()) {
vc_user_access()->wpAny(array('edit_post', (int) vc_request_param('post_id')))->validateDie()->part('frontend_editor')->can()->validateDie();
$this->mode = 'admin_frontend_editor';
} elseif (vc_user_access()->wpAny('edit_posts', 'edit_pages')->get() && ('vc_upgrade' === vc_action() || 'update-selected' === vc_get_param('action') && $this->pluginName() === vc_get_param('plugins'))) {
$this->mode = 'admin_updater';
} elseif (vc_user_access()->wpAny('manage_options')->get() && isset($_GET['page']) && $_GET['page'] === $this->settings()->page()) {
$this->mode = 'admin_settings_page';
} else {
$this->mode = 'admin_page';
}
} else {
if (isset($_GET['vc_editable']) && 'true' === $_GET['vc_editable']) {
vc_user_access()->checkAdminNonce()->validateDie()->wpAny(array('edit_post', (int) vc_request_param('vc_post_id')))->validateDie()->part('frontend_editor')->can()->validateDie();
$this->mode = 'page_editable';
} else {
$this->mode = 'page';
}
}
}
开发者ID:pivotlearning,项目名称:wpsite,代码行数:42,代码来源:js_composer.php
示例19: addMenuPageHooks
/**
* @deprecated, @unused
* Will be removed in v4.6
*/
public function addMenuPageHooks()
{
if (current_user_can('manage_options')) {
add_action('admin_menu', array(&$this, 'addMenuPage'));
add_action('network_admin_menu', array(&$this, 'addMenuPage'));
if (vc_get_param('page') === 'vc_settings' || vc_post_param('action') === 'update') {
add_action('admin_init', array($this, 'initAdmin'));
}
}
}
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:14,代码来源:class-vc-settings.php
注:本文中的vc_get_param函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论