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


PHP _mw_adminimize_get_option_value函数代码示例

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


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

示例1: _mw_adminimize_change_admin_bar

/**
 * Remove items in Admin Bar for current role of current active user
 * Exclude Super Admin, if active
 * Exclude Settings page of Adminimize
 * 
 * @since   1.8.1  01/10/2013
 * @return  void
 */
function _mw_adminimize_change_admin_bar($wp_admin_bar)
{
    // Don't filter on settings page
    if (isset($GLOBALS['current_screen']->base) && 'settings_page_adminimize/adminimize' == $GLOBALS['current_screen']->base) {
        return NULL;
    }
    // Exclude super admin
    if (_mw_adminimize_exclude_super_admin()) {
        return NULL;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    foreach ($user_roles as $role) {
        $disabled_admin_bar_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_admin_bar_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_admin_bar_option_[$role]['0'])) {
            $disabled_admin_bar_option_[$role]['0'] = '';
        }
    }
    foreach ($user_roles as $role) {
        $user = wp_get_current_user();
        if (is_array($user->roles) && in_array($role, $user->roles)) {
            if (current_user_can($role) && is_array($disabled_admin_bar_option_[$role])) {
                foreach ($disabled_admin_bar_option_[$role] as $admin_bar_item) {
                    $wp_admin_bar->remove_node($admin_bar_item);
                }
            }
            // end if
        }
        // end if user roles
    }
}
开发者ID:hram908,项目名称:albertos-project,代码行数:40,代码来源:admin-bar-items.php

示例2: _mw_adminimize_check_to_remove_admin_notices

/**
 * @return bool|null
 */
function _mw_adminimize_check_to_remove_admin_notices()
{
    // Exclude super admin.
    if (_mw_adminimize_exclude_super_admin()) {
        return;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    foreach ($user_roles as $role) {
        $disabled_global_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_global_option_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_global_option_[$role]['0'])) {
            $disabled_global_option_[$role]['0'] = '';
        }
    }
    $remove_admin_notices = FALSE;
    foreach ($user_roles as $role) {
        $user = wp_get_current_user();
        if (is_array($user->roles) && in_array($role, $user->roles)) {
            if (_mw_adminimize_current_user_has_role($role) && isset($disabled_global_option_[$role]) && is_array($disabled_global_option_[$role])) {
                $remove_admin_notices = _mw_adminimize_recursive_in_array('.admin-notices', $disabled_global_option_[$role]);
            }
        }
    }
    return $remove_admin_notices;
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:29,代码来源:remove-admin-notices.php

示例3: _mw_adminimize_dashboard_setup

function _mw_adminimize_dashboard_setup()
{
    global $wp_meta_boxes;
    $adminimizeoptions = get_option('mw_adminimize');
    $widgets = _mw_adminimize_get_dashboard_widgets();
    $adminimizeoptions['mw_adminimize_dashboard_widgets'] = $widgets;
    if (current_user_can('manage_options')) {
        update_option('mw_adminimize', $adminimizeoptions);
    }
    // exclude super admin
    if (_mw_adminimize_exclude_super_admin()) {
        return NULL;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    foreach ($user_roles as $role) {
        $disabled_dashboard_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_dashboard_option_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_dashboard_option_[$role]['0'])) {
            $disabled_dashboard_option_[$role]['0'] = '';
        }
    }
    foreach ($user_roles as $role) {
        $user = wp_get_current_user();
        if (is_array($user->roles) && in_array($role, $user->roles)) {
            if (current_user_can($role) && is_array($disabled_dashboard_option_[$role])) {
                foreach ($disabled_dashboard_option_[$role] as $widget) {
                    if (isset($widgets[$widget]['context'])) {
                        remove_meta_box($widget, 'dashboard', $widgets[$widget]['context']);
                    }
                }
            }
        }
    }
}
开发者ID:asmt3,项目名称:aec,代码行数:35,代码来源:dashboard.php

示例4: _mw_adminimize_dashboard_setup

/**
 * Set dashboard widget options.
 */
function _mw_adminimize_dashboard_setup()
{
    // exclude super admin
    if (_mw_adminimize_exclude_super_admin()) {
        return;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    $disabled_dashboard_option_ = array();
    foreach ($user_roles as $role) {
        $disabled_dashboard_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_dashboard_option_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_dashboard_option_[$role]['0'])) {
            $disabled_dashboard_option_[$role]['0'] = '';
        }
    }
    // Get all widgets.
    $widgets = _mw_adminimize_get_dashboard_widgets();
    // Get current user data.
    $user = wp_get_current_user();
    foreach ($user_roles as $role) {
        if (is_array($user->roles) && is_array($disabled_dashboard_option_[$role]) && in_array($role, $user->roles) && _mw_adminimize_current_user_has_role($role)) {
            foreach ($disabled_dashboard_option_[$role] as $widget) {
                if (isset($widgets[$widget]['context'])) {
                    remove_meta_box($widget, 'dashboard', $widgets[$widget]['context']);
                }
            }
        }
    }
}
开发者ID:pixelswithin,项目名称:sbt,代码行数:33,代码来源:dashboard.php

示例5: _mw_adminimize_change_admin_bar

/**
 * Remove items in Admin Bar for current role of current active user in front end area
 * Exclude Super Admin, if active
 * Exclude Settings page of Adminimize
 *
 * @since   1.8.1  01/10/2013
 */
function _mw_adminimize_change_admin_bar()
{
    // Only for users, there logged in.
    if (!is_user_logged_in()) {
        return;
    }
    // Exclude super admin.
    if (_mw_adminimize_exclude_super_admin()) {
        return;
    }
    /** @var $wp_admin_bar WP_Admin_Bar */
    global $wp_admin_bar;
    // Get current user data.
    $user = wp_get_current_user();
    if (!$user->roles[0]) {
        return;
    }
    $user_role = $user->roles[0];
    // Get Backend Admin Bar settings for the current user role.
    if (is_admin()) {
        $disabled_admin_bar_option_[$user_role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_admin_bar_' . $user_role . '_items');
    } else {
        // Get Frontend Admin Bar settings for the current user role.
        $disabled_admin_bar_option_[$user_role] = (array) _mw_adminimize_get_option_value('mw_adminimize_disabled_admin_bar_frontend_' . $user_role . '_items');
    }
    // No settings for this role, exit.
    if (!$disabled_admin_bar_option_[$user_role]) {
        return;
    }
    foreach ($disabled_admin_bar_option_[$user_role] as $admin_bar_item) {
        $wp_admin_bar->remove_node($admin_bar_item);
    }
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:40,代码来源:admin-bar-items.php

示例6: _mw_adminimize_debug

/**
 * Simple helper to debug to the console of the browser.
 * Set WP_DEBUG_DISPLAY in your wp-config.php to true for view debug messages inside the console.
 *
 * @param string | array | object
 * @param string $description
 */
function _mw_adminimize_debug($data, $description = '')
{
    if (!_mw_adminimize_get_option_value('mw_adminimize_debug')) {
        return;
    }
    if ('' === $description) {
        $description = 'Debug in Console via Adminimize Plugin:';
    }
    $output = 'console.info(' . json_encode($description) . ');';
    $output .= 'console.log(' . json_encode($data) . ');';
    $output = sprintf('<script>%s</script>', $output);
    echo $output;
}
开发者ID:surreal8,项目名称:wptheme,代码行数:20,代码来源:helping_hands.php

示例7: _mw_adminimize_debug

/**
 * Simple helper to debug to the console of the browser.
 * Set WP_DEBUG_DISPLAY in your wp-config.php to true for view debug messages inside the console.
 *
 * @param string | array | object
 * @param string $description
 *
 * @return string|void
 */
function _mw_adminimize_debug($data, $description = '')
{
    if (!_mw_adminimize_get_option_value('mw_adminimize_debug')) {
        return;
    }
    if ('' === $description) {
        $description = 'Debug in Console via Adminimize Plugin:';
    }
    // Buffering to solve problems with WP core, header() etc.
    ob_start();
    $output = 'console.info(' . json_encode($description) . ');';
    $output .= 'console.log(' . json_encode($data) . ');';
    $output = sprintf('<script>%s</script>', $output);
    echo $output;
}
开发者ID:pixelswithin,项目名称:sbt,代码行数:24,代码来源:helping_hands.php

示例8: _e

><?php 
    _e('Comments', FB_ADMINIMIZE_TEXTDOMAIN);
    ?>
 (edit-comments.php)</option>
											<option value="6"<?php 
    if ($_mw_adminimize_db_redirect == '6') {
        echo ' selected="selected"';
    }
    ?>
><?php 
    _e('other Page', FB_ADMINIMIZE_TEXTDOMAIN);
    ?>
</option>
										</select>
										<textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_db_redirect_txt" id="_mw_adminimize_db_redirect_txt" ><?php 
    echo htmlspecialchars(stripslashes(_mw_adminimize_get_option_value('_mw_adminimize_db_redirect_txt')));
    ?>
</textarea>
										<br /><?php 
    _e('You have deactivated the Dashboard, please select a page for redirection or define custom url, include http://?', FB_ADMINIMIZE_TEXTDOMAIN);
    ?>
									</td>
								</tr>
								<?php 
}
?>
						</tbody>
					</table>
					<p id="submitbutton">
						<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php 
_e('Update Options', FB_ADMINIMIZE_TEXTDOMAIN);
开发者ID:Nsteinel,项目名称:jmb,代码行数:31,代码来源:backend_options.php

示例9: esc_attr_e

						<?php 
esc_attr_e('If the user have more as one role and this function is active, Adminimize hide only items, there are active on each role of this user.', 'adminimize');
?>
					</td>
				</tr>
				<tr>
					<td class="row-title"><label for="mw_adminimize_support_bbpress">
							<?php 
esc_attr_e('Support bbPress Roles', 'adminimize');
?>
						</label>
					</td>
					<td>
						<input type="checkbox" value="1" id="mw_adminimize_support_bbpress"
							name="mw_adminimize_support_bbpress" <?php 
checked(_mw_adminimize_get_option_value('mw_adminimize_support_bbpress'), 1, TRUE);
?>
>
						<?php 
esc_attr_e('See the bbPress roles also in each area to hide for this context.', 'adminimize');
?>
					</td>
				</tr>
			</table>

			<p id="submitbutton">
				<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
				<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php 
esc_attr_e('Update Options', 'adminimize');
?>
 &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
开发者ID:pixelswithin,项目名称:sbt,代码行数:31,代码来源:self_settings.php

示例10: _mw_adminimize_change_admin_bar_frontend

/**
 * Remove items in Admin Bar for current role of current active user in front end area
 * Exclude Super Admin, if active
 * Exclude Settings page of Adminimize
 *
 * @since   1.8.1  01/10/2013
 *
 * @param $wp_admin_bar
 *
 * @return null
 */
function _mw_adminimize_change_admin_bar_frontend($wp_admin_bar)
{
    // works only for back end admin bar
    if (is_admin()) {
        return NULL;
    }
    // Exclude super admin
    if (_mw_adminimize_exclude_super_admin()) {
        return NULL;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    $disabled_admin_bar_frontend_option_ = '';
    foreach ($user_roles as $role) {
        $disabled_admin_bar_frontend_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_admin_bar_frontend_option_[$role]['0'])) {
            $disabled_admin_bar_frontend_option_[$role]['0'] = '';
        }
    }
    foreach ($user_roles as $role) {
        $user = wp_get_current_user();
        if (is_array($user->roles) && in_array($role, $user->roles)) {
            if (current_user_can($role) && is_array($disabled_admin_bar_frontend_option_[$role])) {
                foreach ($disabled_admin_bar_frontend_option_[$role] as $admin_bar_item) {
                    $wp_admin_bar->remove_node($admin_bar_item);
                }
            }
            // end if
        }
        // end if user roles
    }
}
开发者ID:Alinea-Interactive,项目名称:Adminimize,代码行数:44,代码来源:admin-bar-items.php

示例11: _mw_adminimize_get_option_value

							<textarea name="_mw_adminimize_own_dashboard_options" cols="60" rows="3"
								id="_mw_adminimize_own_dashboard_options" style="width: 95%;"><?php 
    echo _mw_adminimize_get_option_value('_mw_adminimize_own_dashboard_options');
    ?>
</textarea>
							<br />
							<label for="_mw_adminimize_own_dashboard_options">
								<?php 
    esc_attr_e('Possible nomination for ID or class. Separate multiple nominations through a carriage return.', 'adminimize');
    ?>
							</label>
						</td>
						<td>
							<textarea class="code" name="_mw_adminimize_own_dashboard_values" cols="60" rows="3"
								id="_mw_adminimize_own_dashboard_values" style="width: 95%;"><?php 
    echo _mw_adminimize_get_option_value('_mw_adminimize_own_dashboard_values');
    ?>
</textarea>
							<br />
							<label for="_mw_adminimize_own_dashboard_values">
								<?php 
    esc_attr_e('Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize');
    ?>
							</label>
						</td>
					</tr>
					</tbody>
				</table>

				<p id="submitbutton">
					<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
开发者ID:pixelswithin,项目名称:sbt,代码行数:31,代码来源:dashboard_options.php

示例12: _mw_adminimize_add_admin_footer

/**
 * Print hint in wp-footer
 */
function _mw_adminimize_add_admin_footer()
{
    echo _mw_adminimize_get_option_value('_mw_adminimize_advice_txt') . '<br />';
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:7,代码来源:admin-footer.php

示例13: _mw_adminimize_get_meta_boxes

function _mw_adminimize_get_meta_boxes($post_type = NULL, $context = 'advanced')
{
    $saved_wp_meta_boxes = _mw_adminimize_get_option_value('mw_adminimize_meta_boxes_' . $post_type);
    return $saved_wp_meta_boxes;
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:5,代码来源:meta-boxes.php

示例14: _mw_adminimize_get_option_value

</td>
				</tr>
				<tr valign="top">
					<td>
						<textarea name="_mw_adminimize_own_link_options" cols="60" rows="3" id="_mw_adminimize_own_link_options" style="width: 95%;"><?php 
echo _mw_adminimize_get_option_value('_mw_adminimize_own_link_options');
?>
</textarea>
						<br />
						<?php 
esc_attr_e('Possible nomination for ID or class. Separate multiple nominations through a carriage return.', 'adminimize');
?>
					</td>
					<td>
						<textarea class="code" name="_mw_adminimize_own_link_values" cols="60" rows="3" id="_mw_adminimize_own_link_values" style="width: 95%;"><?php 
echo _mw_adminimize_get_option_value('_mw_adminimize_own_link_values');
?>
</textarea>
						<br />
						<?php 
esc_attr_e('Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize');
?>
					</td>
				</tr>
				</tbody>
			</table>

			<p id="submitbutton">
				<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
				<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php 
esc_attr_e('Update Options', 'adminimize');
开发者ID:surreal8,项目名称:wptheme,代码行数:31,代码来源:links_options.php

示例15: _mw_adminimize_unregister_sidebars

/**
 * Remove sidebars for different roles
 *
 * @return  void
 */
function _mw_adminimize_unregister_sidebars()
{
    // Get settings.
    $adminimizeoptions = _mw_adminimize_get_option_value();
    // Get settings.
    _mw_adminimize_update_option($adminimizeoptions);
    // exclude super admin
    if (_mw_adminimize_exclude_super_admin()) {
        return NULL;
    }
    $user_roles = _mw_adminimize_get_all_user_roles();
    foreach ($user_roles as $role) {
        $disabled_widget_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_widget_option_' . $role . '_items');
    }
    foreach ($user_roles as $role) {
        if (!isset($disabled_widget_option_[$role]['0'])) {
            $disabled_widget_option_[$role]['0'] = '';
        }
    }
    foreach ($user_roles as $role) {
        $user = wp_get_current_user();
        if (is_array($user->roles) && in_array($role, $user->roles)) {
            if (_mw_adminimize_current_user_has_role($role) && is_array($disabled_widget_option_[$role])) {
                foreach ($disabled_widget_option_[$role] as $sidebar) {
                    unregister_sidebar($sidebar);
                }
            }
        }
        // end if user roles
    }
}
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:36,代码来源:widget.php


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