Having Multiple authors for the same WordPress Plugin

Give this a try 1) First add new headers for the plugin meta: add_filter(‘extra_plugin_headers’, ‘add_extra_headers’); function add_extra_headers(){ return array(‘Author2’); } 2) Next filter the authors meta row on output: add_filter(‘plugin_row_meta’, ‘filter_authors_row_meta’, 1, 4); function filter_authors_row_meta($plugin_meta, $plugin_file, $plugin_data, $status ){ if(empty($plugin_data[‘Author’])){ return $plugin_meta; } if ( !empty( $plugin_data[‘Author2’] ) ) { $plugin_meta[1] = $plugin_meta[1] . ‘, … Read more

WordPress wp-json API – Custom Post Type returns 403

In version 1.1 of the JSON REST API custom post type endpoints have to be registered manually. See: http://wp-api.org/guides/extending.html#registering-your-endpoints In version 2.0 we register endpoints for any custom post types registered with the show_in_rest property set to true. Documentation on how to do this: http://v2.wp-api.org/extending/custom-content-types/#registering-a-custom-post-type-with-rest-api-support

Override Widget class in plugins with custom plugin

You’re actually quite close to answering your own question. Your plugin would have to start with checking whether the plugin is active (which you can also do with function_exists). The you indeed can use remove_action to make sure functions and classes aren’t activated. This doesn’t mean these functions become undefined. So yes, you will need … Read more

What exactly does $wp_filesystem->abspath() return?

If you check out the source of abspath(): public function abspath() { $folder = $this->find_folder(ABSPATH); // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare. if ( ! $folder && $this->is_dir( “https://wordpress.stackexchange.com/” . WPINC ) ) $folder=”https://wordpress.stackexchange.com/”; return $folder; } .. … Read more

OEmbed from Pinterest

I found that https://wordpress.org/plugins/pinterest-widgets actually has the needed functionality but doesn’t mention it in the description. After installing and activating you can add a pinboard to a post by using the following shortcodes [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”header”] [pin_board url=”http://www.pinterest.com/pinterest/pin-pets/” size=”custom” image_width=”100″ board_width=”900″ board_height=”450″] more options can be found on the plugins “settings” page after … Read more

Plugin development: how to create a form and get custom data?

The details of processing form data is specific to PHP therefore I will not go into it. The WordPress-specific part is that you want your code to be run on the ‘init’ event in order to have access to WordPress functions and globals (such as the users permissions). <?php add_action(‘init’, function(){ $reservation_capacity = sanitize_text_field( $_POST[‘reservation_capacity’] … Read more

Files being generated in multiple directories supposedly by WordPress (advanced_settings.php and common_config.php)

These files are part of a PHP malware infection. We are in the process of cleaning up an ongoing infection that has a very similar behavior. While this PHP malware also infects non WordPress as well, when it attacks a WordPress site, we are noticing some very consistent patterns: Two files (“advanced_settings.php” and “common_config.php”) which … Read more