Implementing namespaces in plugin template

The problem is with your Autoloader set-up. You need to convert your Camelcase namespacese to dashes for locating files as per your current folder structure. I have added convert function and updated your autoloader function. In wp-plugin-template/autoloader.php: <?php spl_autoload_register( ‘autoload_function’ ); function autoload_function( $classname ) { $class = str_replace( ‘\\’, DIRECTORY_SEPARATOR, str_replace( ‘_’, ‘-‘, strtolower(convert($classname)) … Read more

I should hide the API Key in a plugin?

There is nothing you can do to hide the API keys. If you look at the wp-config.php file, it contains the username and password to access the database in plain text. WordPress doesn’t even try obfuscate them. If you’re distributing this plugin, another options would be to have the plugin users each obtain an API … Read more

Can I get all options using the option group id? [closed]

I don’t think there is a function. But you can create your own like this function function_name(){ global $new_whitelist_options; // array of option names $option_names = $new_whitelist_options[ ‘your_option_group_name’ ]; // your_option_group_name is in register_setting( ‘your_option_group_name’, $option_name, $sanitize_callback ); foreach ($option_names as $option_name) { echo get_option($option_name).'<br>’; } } See: here EDIT: $new_whitelist_options was renamed to $new_allowed_options … Read more

Ensuring a plugin is loaded/run last?

You’ll want to hook into “the_content” filter at a very high priority. Example: function my_alter_the_content( $content ) { if ( in_array( get_post_type(), array( ‘post’, ‘page’ ) ) ) { // Do stuff here for posts and pages } return $content; } add_action( ‘the_content’, ‘my_alter_the_content’, PHP_INT_MAX ); Using the PHP_INT_MAX constant for the hook priority you … Read more