當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ITSEC_Core::get_wp_upload_dir方法代碼示例

本文整理匯總了PHP中ITSEC_Core::get_wp_upload_dir方法的典型用法代碼示例。如果您正苦於以下問題:PHP ITSEC_Core::get_wp_upload_dir方法的具體用法?PHP ITSEC_Core::get_wp_upload_dir怎麽用?PHP ITSEC_Core::get_wp_upload_dir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ITSEC_Core的用法示例。


在下文中一共展示了ITSEC_Core::get_wp_upload_dir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render_settings

    protected function render_settings($form)
    {
        if (!defined('DOING_AJAX') || !DOING_AJAX) {
            echo '<p>' . __('Click the button to load the current file permissions.', 'better-wp-security') . '</p>';
            echo '<p>' . $form->add_button('load_file_permissions', array('value' => __('Load File Permissions Details', 'better-wp-security'), 'class' => 'button-primary itsec-reload-module')) . '</p>';
            return;
        }
        require_once ITSEC_Core::get_core_dir() . '/lib/class-itsec-lib-config-file.php';
        $wp_upload_dir = ITSEC_Core::get_wp_upload_dir();
        $path_data = array(array(ABSPATH, 0755), array(ABSPATH . WPINC, 0755), array(ABSPATH . 'wp-admin', 0755), array(ABSPATH . 'wp-admin/js', 0755), array(WP_CONTENT_DIR, 0755), array(get_theme_root(), 0755), array(WP_PLUGIN_DIR, 0755), array($wp_upload_dir['basedir'], 0755), array(ITSEC_Lib_Config_File::get_wp_config_file_path(), 0444), array(ITSEC_Lib_Config_File::get_server_config_file_path(), 0444));
        $rows = array();
        foreach ($path_data as $path) {
            $row = array();
            list($path, $suggested_permissions) = $path;
            $display_path = preg_replace('/^' . preg_quote(ABSPATH, '/') . '/', '', $path);
            $display_path = ltrim($display_path, '/');
            if (empty($display_path)) {
                $display_path = '/';
            }
            $row[] = $display_path;
            $row[] = sprintf('%o', $suggested_permissions);
            $permissions = fileperms($path) & 0777;
            $row[] = sprintf('%o', $permissions);
            if (!$permissions || $permissions != $suggested_permissions) {
                $row[] = __('WARNING', 'better-wp-security');
                $row[] = '<div style="background-color: #FEFF7F; border: 1px solid #E2E2E2;">&nbsp;&nbsp;&nbsp;</div>';
            } else {
                $row[] = __('OK', 'better-wp-security');
                $row[] = '<div style="background-color: #22EE5B; border: 1px solid #E2E2E2;">&nbsp;&nbsp;&nbsp;</div>';
            }
            $rows[] = $row;
        }
        $class = 'entry-row';
        ?>
	<p><?php 
        $form->add_button('reload_file_permissions', array('value' => __('Reload File Permissions Details', 'better-wp-security'), 'class' => 'button-primary itsec-reload-module'));
        ?>
</p>
	<table class="widefat">
		<thead>
			<tr>
				<th><?php 
        _e('Relative Path', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Suggestion', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Value', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Result', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Status', 'better-wp-security');
        ?>
</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<th><?php 
        _e('Relative Path', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Suggestion', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Value', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Result', 'better-wp-security');
        ?>
</th>
				<th><?php 
        _e('Status', 'better-wp-security');
        ?>
</th>
			</tr>
		</tfoot>
		<tbody>
			<?php 
        foreach ($rows as $row) {
            ?>
				<tr class="<?php 
            echo $class;
            ?>
">
					<?php 
            foreach ($row as $column) {
                ?>
						<td><?php 
                echo $column;
//.........這裏部分代碼省略.........
開發者ID:Garth619,項目名稱:Femi9,代碼行數:101,代碼來源:settings-page.php


注:本文中的ITSEC_Core::get_wp_upload_dir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。