本文整理汇总了PHP中ReduxFramework::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ReduxFramework::init方法的具体用法?PHP ReduxFramework::init怎么用?PHP ReduxFramework::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReduxFramework
的用法示例。
在下文中一共展示了ReduxFramework::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
public function load()
{
$redux = new ReduxFramework();
$redux->init();
//if ( ! empty( $redux ) ) {
$dir = ReduxFramework::$_dir . '../';
if (!ReduxFramework::$_is_plugin) {
$errors = array();
if (file_exists($dir . '.tx')) {
$errors[] = ".tx/";
}
if (file_exists($dir . 'bin')) {
$errors[] = "bin/";
}
if (file_exists($dir . 'tests')) {
$errors[] = "tests/";
}
if (file_exists($dir . '.gitignore')) {
$errors[] = ".gitignore";
}
if (file_exists($dir . '.git')) {
$errors[] = ".git/";
}
if (file_exists($dir . 'node_modules')) {
$errors[] = "node_modules/";
}
if (file_exists($dir . '.travis.yml')) {
$errors[] = ".travis.yml";
}
if (file_exists($dir . 'bootstrap_tests.php')) {
$errors[] = "bootstrap_tests.php";
}
if (file_exists($dir . 'phpunit.xml')) {
$errors[] = "phpunit.xml";
}
if (file_exists($dir . '.ds_store')) {
$errors[] = ".ds_store";
}
if (file_exists($dir . 'codestyles')) {
$errors[] = "codestyles/";
}
if (!empty($errors)) {
?>
<div class="error">
<p><?php
echo 'The following directories & files are still located in your <strong>Redux</strong> directory. They may cause errors in Theme-Check.';
echo '<br /><ul style="margin-left:15px;">';
foreach ($errors as $error) {
echo '<li><strong>~/' . $error . '</strong></li>';
}
?>
</ul></p></div><?php
}
}
}
示例2: create_data_string
}
}
return $params;
}
/**
* converts an array into a html data string
*
* @param array $data example input: array('id'=>'true')
* @return string $data_string example output: data-id='true'
*/
public function create_data_string($data = array())
{
$data_string = "";
foreach ($data as $key => $value) {
if (is_array($value)) {
$value = implode("|", $value);
}
$data_string .= " data-{$key}='{$value}' ";
}
return $data_string;
}
}
// ReduxFramework
/**
* action 'redux/init'
* @param null
*/
do_action('redux/init', ReduxFramework::init());
//add_action( 'plugins_loaded', ReduxFramework::init(), 0 );
}
// class_exists('ReduxFramework')
示例3: load
public function load()
{
$redux = new ReduxFramework();
$redux->init();
//if ( ! empty( $redux ) ) {
$dir = ReduxFramework::$_dir . '../';
if (isset($_POST['themename']) && !empty($_POST['themename'])) {
if (strpos($dir, $_POST['themename']) !== false) {
?>
<div class="updated">
<p><?php
echo sprintf(esc_html__('The theme you are testing has %s embedded. We invite you to read the %sTheme-Check Documentation%s to understand some warnings you will see because of Redux.', 'redux-framework'), '<a href="' . esc_url('http://reduxframework.com') . '" target="_blank">Redux Framework</a>', '<a href="' . esc_url('http://docs.reduxframework.com/core/theme-check/') . '">', '</a>');
?>
</div><?php
}
}
if (!ReduxFramework::$_is_plugin) {
$errors = array();
if (file_exists($dir . '.tx')) {
$errors[] = ".tx/";
}
if (file_exists($dir . 'bin')) {
$errors[] = "bin/";
}
if (file_exists($dir . 'tests')) {
$errors[] = "tests/";
}
if (file_exists($dir . '.gitignore')) {
$errors[] = ".gitignore";
}
if (file_exists($dir . '.git')) {
$errors[] = ".git/";
}
if (file_exists($dir . 'node_modules')) {
$errors[] = "node_modules/";
}
if (file_exists($dir . '.travis.yml')) {
$errors[] = ".travis.yml";
}
if (file_exists($dir . 'bootstrap_tests.php')) {
$errors[] = "bootstrap_tests.php";
}
if (file_exists($dir . 'phpunit.xml')) {
$errors[] = "phpunit.xml";
}
if (file_exists($dir . '.ds_store')) {
$errors[] = ".ds_store";
}
if (file_exists($dir . 'codestyles')) {
$errors[] = "codestyles/";
}
if (!empty($errors)) {
?>
<div class="error">
<p><?php
esc_html_e('The following directories & files are still located in your <strong>Redux</strong> directory. They may cause errors in Theme-Check.', 'redux-framework');
echo '<br /><ul style="margin-left:15px;">';
foreach ($errors as $error) {
echo '<li><strong>~/' . $error . '</strong></li>';
}
?>
</ul></p></div><?php
}
}
}
示例4: create_data_string
if (!$return) {
$params['class_string'] = ' hiddenFold ';
$this->fieldsHidden[$field['id']] = true;
} else {
$params['class_string'] = ' showFold ';
}
}
return $params;
}
/**
* converts an array into a html data string
*
* @param array $data example input: array('id'=>'true')
* @return string $data_string example output: data-id='true'
*/
public function create_data_string($data = array())
{
$data_string = "";
foreach ($data as $key => $value) {
if (is_array($value)) {
$value = implode("|", $value);
}
$data_string .= " data-{$key}='{$value}' ";
}
return $data_string;
}
}
// class
ReduxFramework::init();
}
// if