This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: Your Plugin Name | |
| * Description: Your plugin description. | |
| * Version: 1.0.0 | |
| * Author: Your Name | |
| * License: GPL-2.0+ | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
| * | |
| * @package YourPluginNamespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Registers the "One time hook" functionality. | |
| * | |
| * Note that this file is intentionally in the *global* namespace! | |
| * | |
| * @author Growella | |
| * @license MIT | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # error_log('Red Alert: Shields failing! Code malfunction in sector 42.'); | |
| add_action('activated_plugin', 'save_error_to_log'); | |
| function save_error_to_log() { | |
| // Get the error message (if any) during plugin activation | |
| $error_message = ob_get_contents(); | |
| // Define the log file path (adjust as needed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #This is required if remove fatal error will occur | |
| if ( ! defined( 'AYS_PLUGIN_PATH' ) ) { | |
| define( 'AYS_PLUGIN_PATH', wp_normalize_path( plugin_dir_path( __FILE__ ) ) ); | |
| } | |
| spl_autoload_register( function ( $class_name ) { | |
| // Log the class name being attempted to load | |
| error_log( "Autoloader: Attempting to load class $class_name" ); | |
| // Only autoload classes that start with 'Ays_' | |
| if ( strpos( $class_name, 'Ays_' ) !== 0 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Initialize the class. | |
| // Array of class names to instantiate | |
| $classes = [ | |
| 'Ays_CPT_FAQ', | |
| 'Ays_CPT_Location', | |
| 'Ays_CPT_Review', | |
| 'Ays_CPT_Service', | |
| 'Ays_CPT_Team', | |
| ]; |
OlderNewer