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

PHP get_real_file_to_edit函数代码示例

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

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



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

示例1: get_option

		}
	}
}

$recents = get_option('recently_edited');

if (empty($file)) {
	if ($recents) {
		$file = $recents[0];
	} else {
		$file = 'index.php';
	}
}

$file = validate_file_to_edit($file);
$real_file = get_real_file_to_edit($file);

switch($action) {

case 'update':

	if ($user_level < 5) {
		die(__('<p>You have do not have sufficient permissions to edit templates for this blog.</p>'));
	}

	$newcontent = stripslashes($_POST['newcontent']);
	if (is_writeable($real_file)) {
		$f = fopen($real_file, 'w+');
		fwrite($f, $newcontent);
		fclose($f);
		header("Location: templates.php?file=$file&a=te");
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:templates.php


示例2: get_plugins

                ${$wpvar} = '';
            } else {
                ${$wpvar} = $_GET["{$wpvar}"];
            }
        } else {
            ${$wpvar} = $_POST["{$wpvar}"];
        }
    }
}
$plugins = get_plugins();
$plugin_files = array_keys($plugins);
if (empty($file)) {
    $file = $plugin_files[0];
}
$file = validate_file_to_edit($file, $plugin_files);
$real_file = get_real_file_to_edit("wp-content/plugins/{$file}");
switch ($action) {
    case 'update':
        check_admin_referer('edit-plugin_' . $file);
        if (!current_user_can('edit_plugins')) {
            die('<p>' . __('You have do not have sufficient permissions to edit templates for this blog.') . '</p>');
        }
        $newcontent = stripslashes($_POST['newcontent']);
        if (is_writeable($real_file)) {
            $f = fopen($real_file, 'w+');
            fwrite($f, $newcontent);
            fclose($f);
            wp_redirect("plugin-editor.php?file={$file}&a=te");
        } else {
            wp_redirect("plugin-editor.php?file={$file}");
        }
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:plugin-editor.php


示例3: __

require_once 'admin.php';
$title = __("Edit Plugins");
$parent_file = 'plugins.php';
wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
add_action('admin_head', 'theme_editor_css');
function theme_editor_css()
{
    wp_admin_css('css/theme-editor');
}
$plugins = get_plugins();
$plugin_files = array_keys($plugins);
if (empty($file)) {
    $file = $plugin_files[0];
}
$file = validate_file_to_edit($file, $plugin_files);
$real_file = get_real_file_to_edit(PLUGINDIR . "/{$file}");
switch ($action) {
    case 'update':
        check_admin_referer('edit-plugin_' . $file);
        if (!current_user_can('edit_plugins')) {
            wp_die('<p>' . __('You do not have sufficient permissions to edit templates for this blog.') . '</p>');
        }
        $newcontent = stripslashes($_POST['newcontent']);
        if (is_writeable($real_file)) {
            $f = fopen($real_file, 'w+');
            fwrite($f, $newcontent);
            fclose($f);
            // Deactivate so we can test it.
            if (is_plugin_active($file) || isset($_POST['phperror'])) {
                if (is_plugin_active($file)) {
                    deactivate_plugins($file, true);
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:plugin-editor.php


示例4: read_tag

function read_tag($tag, $contents)
{
    $theTag = strstr($contents, 'get_' . $tag . '(');
    //when the tag doesnt exist, return nothing, or it will take the standard file
    if (!$theTag) {
        return '';
    }
    $theTag = str_replace('get_' . $tag . '(', '', $theTag);
    if (strpos($theTag, ')') != 0) {
        $theTag = substr($theTag, 0, strpos($theTag, ')'));
    } else {
        $theTag = '';
    }
    $theTag = str_replace('\'', '', $theTag);
    //remove '
    $theTag = str_replace('&quot;', '', $theTag);
    //remove "
    $fileToRead = get_template_directory_uri() . '/';
    $fileToRead .= $tag;
    if ($theTag) {
        $fileToRead .= '-' . $theTag;
    }
    $fileToRead .= '.php';
    $fileToRead = strstr($fileToRead, '/themes/');
    $fileToRead = validate_file_to_edit($fileToRead, $allowed_files);
    $fileToRead = get_real_file_to_edit($fileToRead);
    //first try to read the child theme, otherwise use the normal theme
    $themes = get_themes();
    $theme = $themes[get_current_theme()];
    $current_theme_url = $theme['Template'];
    $child_theme_url = str_replace('themes/', '', strstr(get_stylesheet_directory_uri(), 'themes/'));
    if (fopen(str_replace($current_theme_url, $child_theme_url, $fileToRead), 'r')) {
        //child theme exists
        $fileToRead = str_replace($current_theme_url, $child_theme_url, $fileToRead);
        $f = fopen($fileToRead, 'r');
    } else {
        $f = fopen($fileToRead, 'r');
    }
    $tagContents = fread($f, filesize($fileToRead));
    $tagContents = htmlspecialchars($tagContents);
    return $tagContents;
}
开发者ID:niko-lgdcom,项目名称:barrows,代码行数:42,代码来源:multiple_content.php


示例5: require_once

require_once('admin.php');

$title = __("Edit Plugins");
$parent_file = 'plugins.php';

wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));

$plugins = get_plugins();
$plugin_files = array_keys($plugins);

if (empty($file)) {
	$file = $plugin_files[0];
}

$file = validate_file_to_edit($file, $plugin_files);
$real_file = get_real_file_to_edit( PLUGINDIR . "/$file");

switch($action) {

case 'update':

	check_admin_referer('edit-plugin_' . $file);

	if ( !current_user_can('edit_plugins') )
		wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');

	$newcontent = stripslashes($_POST['newcontent']);
	if (is_writeable($real_file)) {
		$f = fopen($real_file, 'w+');
		fwrite($f, $newcontent);
		fclose($f);
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:plugin-editor.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_real_interface函数代码示例发布时间:2022-05-15
下一篇:
PHP get_real_class函数代码示例发布时间: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