PHP code example of wordpress-phoenix / abstract-theme-base
1. Go to this page and download the library: Download wordpress-phoenix/abstract-theme-base library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wordpress-phoenix / abstract-theme-base example snippets
// Avoid direct calls to this file, because now WP core and framework has been used
if ( ! function_exists( 'add_filter' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
$current_dir = trailingslashit( dirname( __FILE__ ) );
/**
* 3RD PARTY DEPENDENCIES
* (manually he main theme application and initialize it.
*/
namespace Custom\My_theme;
use WPAZ_Theme_Base\V_2_6\Abstract_Theme;
/**
* Class App
*/
class Theme extends Abstract_Theme {
public static $autoload_class_prefix = __NAMESPACE__;
// Set to 2 when you use 2 namespaces in the main app file
public static $autoload_ns_match_depth = 2;
public function onload( $instance ) {
// Nothing yet
}
public function init() {
do_action( static::class . '_before_init' );
// Do theme stuff usually looks something like
// $subclass = new OptionalAppSubfolder\Custom_Class_Subclass();
// $subclass->custom_theme_function();
do_action( static::class . '_after_init' );
}
public function authenticated_init() {
if ( ! is_user_logged_in() ) {
return;
}
// Ready for wp-admin - but not