本文整理汇总了PHP中Redux::getExtensions方法的典型用法代码示例。如果您正苦于以下问题:PHP Redux::getExtensions方法的具体用法?PHP Redux::getExtensions怎么用?PHP Redux::getExtensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redux
的用法示例。
在下文中一共展示了Redux::getExtensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compileSystemStatus
//.........这里部分代码省略.........
$sysinfo['mysql_ver'] = $wpdb->db_version();
$sysinfo['max_upload_size'] = size_format(wp_max_upload_size());
$sysinfo['def_tz_is_utc'] = 'true';
if (date_default_timezone_get() !== 'UTC') {
$sysinfo['def_tz_is_utc'] = 'false';
}
$sysinfo['fsockopen_curl'] = 'false';
if (function_exists('fsockopen') || function_exists('curl_init')) {
$sysinfo['fsockopen_curl'] = 'true';
}
//$sysinfo['soap_client'] = 'false';
//if ( class_exists( 'SoapClient' ) ) {
// $sysinfo['soap_client'] = 'true';
//}
//
//$sysinfo['dom_document'] = 'false';
//if ( class_exists( 'DOMDocument' ) ) {
// $sysinfo['dom_document'] = 'true';
//}
//$sysinfo['gzip'] = 'false';
//if ( is_callable( 'gzopen' ) ) {
// $sysinfo['gzip'] = 'true';
//}
if ($remote_checks == true) {
$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', array('sslverify' => false, 'timeout' => 60, 'user-agent' => 'ReduxFramework/' . ReduxFramework::$_version, 'body' => array('cmd' => '_notify-validate')));
if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
$sysinfo['wp_remote_post'] = 'true';
$sysinfo['wp_remote_post_error'] = '';
} else {
$sysinfo['wp_remote_post'] = 'false';
$sysinfo['wp_remote_post_error'] = $response->get_error_message();
}
$response = wp_remote_get('http://reduxframework.com/wp-admin/admin-ajax.php?action=get_redux_extensions');
if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
$sysinfo['wp_remote_get'] = 'true';
$sysinfo['wp_remote_get_error'] = '';
} else {
$sysinfo['wp_remote_get'] = 'false';
$sysinfo['wp_remote_get_error'] = $response->get_error_message();
}
}
$active_plugins = (array) get_option('active_plugins', array());
if (is_multisite()) {
$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
}
$sysinfo['plugins'] = array();
foreach ($active_plugins as $plugin) {
$plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
$plugin_name = esc_html($plugin_data['Name']);
$sysinfo['plugins'][$plugin_name] = $plugin_data;
}
$redux = ReduxFrameworkInstances::get_all_instances();
$sysinfo['redux_instances'] = array();
if (!empty($redux) && is_array($redux)) {
foreach ($redux as $inst => $data) {
Redux::init($inst);
$sysinfo['redux_instances'][$inst]['args'] = $data->args;
$sysinfo['redux_instances'][$inst]['sections'] = $data->sections;
foreach ($sysinfo['redux_instances'][$inst]['sections'] as $sKey => $section) {
if (isset($section['fields']) && is_array($section['fields'])) {
foreach ($section['fields'] as $fKey => $field) {
if (isset($field['validate_callback'])) {
unset($sysinfo['redux_instances'][$inst]['sections'][$sKey]['fields'][$fKey]['validate_callback']);
}
if ($field['type'] == "js_button") {
if (isset($field['script']) && isset($field['script']['ver'])) {
unset($sysinfo['redux_instances'][$inst]['sections'][$sKey]['fields'][$fKey]['script']['ver']);
}
}
}
}
}
$sysinfo['redux_instances'][$inst]['extensions'] = Redux::getExtensions($inst);
if (isset($data->extensions['metaboxes'])) {
$data->extensions['metaboxes']->init();
$sysinfo['redux_instances'][$inst]['metaboxes'] = $data->extensions['metaboxes']->boxes;
}
if (isset($data->args['templates_path']) && $data->args['templates_path'] != '') {
$sysinfo['redux_instances'][$inst]['templates'] = self::getReduxTemplates($data->args['templates_path']);
}
}
}
$active_theme = wp_get_theme();
$sysinfo['theme']['name'] = $active_theme->Name;
$sysinfo['theme']['version'] = $active_theme->Version;
$sysinfo['theme']['author_uri'] = $active_theme->{'Author URI'};
$sysinfo['theme']['is_child'] = self::makeBoolStr(is_child_theme());
if (is_child_theme()) {
$parent_theme = wp_get_theme($active_theme->Template);
$sysinfo['theme']['parent_name'] = $parent_theme->Name;
$sysinfo['theme']['parent_version'] = $parent_theme->Version;
$sysinfo['theme']['parent_author_uri'] = $parent_theme->{'Author URI'};
}
//if ( $json_output ) {
// $sysinfo = json_encode( $sysinfo );
//}
//print_r($sysinfo);
//exit();
return $sysinfo;
}