Skip to content

Instantly share code, notes, and snippets.

@codeiscode-dev
Last active January 24, 2018 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeiscode-dev/fdcb82423e356e3e0778ea41eceb61c8 to your computer and use it in GitHub Desktop.
Save codeiscode-dev/fdcb82423e356e3e0778ea41eceb61c8 to your computer and use it in GitHub Desktop.
wpep_before_template_part
<?php
do_action( 'wpep_before_template_part', $template_name, $template_path, $located, $args );
<?php
public function load_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
if ( $args && is_array( $args ) ) {
extract( $args );
}
$located = $this->locate_template( $template_name, $template_path, $default_path );
if ( ! file_exists( $located ) ) {
_doing_it_wrong( __FUNCTION__, sprintf( '%s does not exist.', $located ), '1.0.0' );
return;
}
// Allow 3rd party plugin filter template file from their plugin
$located = apply_filters( 'wpep_get_template', $located, $template_name, $args, $template_path, $default_path );
do_action( 'wpep_before_template_part', $template_name, $template_path, $located, $args );
include( $located );
do_action( 'wpep_after_template_part', $template_name, $template_path, $located, $args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment