Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins

I guess this would be of better use as a mu-plugin. EDIT: Now available as drop & play MU-Plugin. Also disables the »Theme« editor. <?php ! defined( ‘ABSPATH’ ) AND exit; /** Plugin Name: Disable »Theme/Plugin Editor« */ if ( ! class_exists( ‘disable_admin_editor’ ) ) { add_action( ‘plugins_loaded’, array( ‘disable_admin_editor’, ‘init’ ) ); class disable_admin_editor … Read more

how to invoke wordpress API from other existing PHP system

You can add the following snippet at the start of your PHP file to load WordPress in it. define( ‘WP_USE_THEMES’, false ); require(‘wp-blog-header.php’); // chage the path to match your WP directory //the rest of your code here EDIT: Alternatively, you could use wp-load.php instead of wp-blog-header.php. define( ‘WP_USE_THEMES’, false ); require(‘wp-load.php’); // chage the … Read more

Change plugin name on WordPress repo

You can change the name of your plugin, you just can’t change the url slug of your plugin. Meaning, if you initially added a plugin to the repo and it was called “Posts With Ad Thumbnails” your url would be: https://wordpress.org/plugins/posts-with-ad-thumbnails/ After uploading your plugin, if you decide to change the name just edit your … Read more

White screen when activating plugin that sends form via WordPress

you should remove: require(‘http://solutionsagencia.com.br/comparasaude/wp-load.php’); and use: require(ABSPATH.’wp-includes/pluggable.php’); p.s. I advice you, these executions should be hooked in ‘init’, like: add_action(‘init’, function(){ $para = “[email protected]”; $assunto = “Assunto” . $nome; $conteudo = “<b>Nome:</b> {$nome}” . “<b>Email:</b> {$email}” . $headers = array( ‘Reply-To’ => $name . ‘<‘ . $email . ‘>’, ); $status = wp_mail( $para, $assunto, … Read more