get_front_page_template

Definition:
function get_front_page_template() {}

Retrieve path of front-page template in current or parent template.
Looks for ‘front-page.php’.

Source code

function get_front_page_template() {

	$templates = array('front-page.php');



	return get_query_template( 'front_page', $templates );

}

1400

get_footer

Definition:
function get_footer( $name = null ) {}

Load footer template.
Includes the footer template for a theme or if a name is specified then a specialised footer will be included.

Parameters

  • string $name: The name of the specialised footer.

Defined actions

  • get_footer
    do_action( 'get_footer', $name );

Source code

function get_footer( $name = null ) {

	do_action( 'get_footer', $name );



	$templates = array();

	if ( isset($name) )

		$templates[] = "footer-{$name}.php";

1398

get_file_description

Definition:
function get_file_description( $file ) {}

Get the description for standard WordPress theme files and other various standard WordPress files

Parameters

  • string $file: Filesystem path or filename

Return values

returns:Description of file from $wp_file_descriptions or basename of $file if description doesn’t exist

Source code

function get_file_description( $file ) {

	global $wp_file_descriptions;



	if ( isset( $wp_file_descriptions[basename( $file )] ) ) {

		return $wp_file_descriptions[basename( $file )];

	}

	elseif ( file_exists( $file ) && is_file( $file ) ) {

		$template_data = implode( '', file( $file ) );

		if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name ))

			return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) );

	}



	return basename( $file );

}

1396

get_file_data

Definition:
function get_file_data( $file, $default_headers, $context = '' ) {}

Retrieve metadata from a file.
Searches for metadata in the first 8kiB of a file, such as a plugin or theme. Each piece of metadata must be on its own line. Fields can not span multiple lines, the value will get cut at the end of the first line.

Parameters

  • string $file: Path to the file
  • array $default_headers: List of headers, in the format array(‘HeaderKey’ => ‘Header Name’)
  • string $context: If specified adds filter hook “extra_{$context}_headers”

Defined filters

  • extra_{$context}_headers
    apply_filters( "extra_{$context}_headers", array()

Source code

function get_file_data( $file, $default_headers, $context = '' ) {

	// We don't need to write to the file, so just open for reading.

	$fp = fopen( $file, 'r' );



	// Pull only the first 8kiB of the file in.

	$file_data = fread( $fp, 8192 );



	// PHP will close file handle, but we are good citizens.

	fclose( $fp );



	if ( $context != '' ) {

		$extra_headers = apply_filters( "extra_{$context}_headers", array() );



		$extra_headers = array_flip( $extra_headers );

		foreach( $extra_headers as $key=>$value ) {

			$extra_headers[$key] = $key;

		}

		$all_headers = array_merge( $extra_headers, (array) $default_headers );

	} else {

1394

get_filesystem_method

Definition:
function get_filesystem_method($args = array() {}

Determines which Filesystem Method to use.
The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsockopen())

Parameters

  • array $args: Connection details.
  • string $context: Full path to the directory that is tested for being writable.

Return values

returns:The transport to use, see description for valid return values.

Defined filters

  • filesystem_method
    apply_filters('filesystem_method', $method, $args)

Source code

function get_filesystem_method($args = array(), $context = false) {

	$method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets'



	if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){

		if ( !$context )

			$context = WP_CONTENT_DIR;

		$context = trailingslashit($context);

		$temp_file_name = $context . 'temp-write-test-' . time();

		$temp_handle = @fopen($temp_file_name, 'w');

		if ( $temp_handle ) {

			if ( getmyuid() == @fileowner($temp_file_name) )

				$method = 'direct';

			@fclose($temp_handle);

			@unlink($temp_file_name);

		}

 	}



	if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && function_exists('stream_get_contents') ) $method = 'ssh2';

	if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';

	if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread

	return apply_filters('filesystem_method', $method, $args);

}

1392