Create filter for home path
-
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin */ if ( ! defined( 'WPSEO_VERSION' ) ) { header( 'Status: 403 Forbidden' ); header( 'HTTP/1.1 403 Forbidden' ); exit(); } $yform = Yoast_Form::get_instance(); $home_path = get_home_path(); if ( ! is_writable( $home_path ) && ! empty( $_SERVER['DOCUMENT_ROOT'] ) ) { $home_path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR; } $robots_file = $home_path . 'robots.txt'; $ht_access_file = $home_path . '.htaccess'; if ( isset( $_POST['create_robots'] ) ) { if ( ! current_user_can( 'edit_files' ) ) { $die_msg = sprintf( /* translators: %s expands to robots.txt. */ __( 'You cannot create a %s file.', 'wordpress-seo' ), 'robots.txt' ); die( esc_html( $die_msg ) ); } check_admin_referer( 'wpseo_create_robots' ); ob_start(); error_reporting( 0 ); do_robots(); $robots_content = ob_get_clean(); $f = fopen( $robots_file, 'x' ); fwrite( $f, $robots_content ); }Is it possible to create a filter to override the homepath?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Create filter for home path’ is closed to new replies.