This file contains 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', | |
]; |
This file contains 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 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 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 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 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
👸🏻: Let's break down your ideas based on the **"Register and add settings page"** file you shared and explore ways to incorporate licensing, custom post types, and toggles on the settings page. | |
### Key Points from the File: | |
1. **Settings Page Structure**: | |
- You have a clear framework to add settings, which includes registering options, adding fields, and sanitizing input. | |
- This is an excellent base for further expansion. | |
2. **What You Want**: | |
- **Licensing/Key Registration**: You want a licensing system where you can store and validate a key. | |
- **Custom Post Types**: A section to manage custom post types. |
This file contains 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: Site Plugin | |
Description: Site-specific code with support for Gutenberg blocks | |
Author: Shaun Palmer | |
Author URI: https://yourwebsite.com/ | |
*/ | |
class SP_SitePlugin { |
This file contains 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 | |
/* | |
* Select one or more of the options below to your wp-config.php file to have WordPress updates run automatically. | |
*/ | |
// Apply Major WordPress Updates Automatically | |
define( 'WP_AUTO_UPDATE_CORE', true ); | |
// Apply Minor WordPress Updates Automatically |
This file contains 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 | |
# http://kovshenin.com/2012/the-wordpress-settings-api/ | |
# http://codex.wordpress.org/Settings_API | |
add_action( 'admin_menu', 'my_admin_menu' ); | |
function my_admin_menu() { | |
add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' ); | |
} | |
add_action( 'admin_init', 'my_admin_init' ); |
This file contains 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: Testimonials Custom Post Type | |
Plugin URI: http://wpbeaches.com/create-custom-post-types-in-genesis-child-theme-in-wordpress/ | |
Description: Testimonials Custom Post Types | |
Author: Neil Gowran | |
Version:1.0.0 | |
Author URI:http://wpbeaches.com | |
*/ |
NewerOlder