How Can I add Fields in wp-option table?
If you just want to create a field, add_option() will do just fine, but I would strongly recommend using update_option() instead, as it tends to be the better choice for most applications.
If you just want to create a field, add_option() will do just fine, but I would strongly recommend using update_option() instead, as it tends to be the better choice for most applications.
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
Check if you have a class or function with many echo‘s, that are called on the functions register_activation_hook or register_deactivation_hook. Also – this functions must use static functions. Also, is it possible that you have a var_dump() inside your source? It is important that you not have an output (like echo or var_dump) on activation … Read more
WordPress AJAX best practices are following: Use wp_localize_script to declare JavaScript global variables; Use admin-ajax.php script to handle all AJAX requests; Use nonces and check for permissions; Use jQuery Form plugin to submit forms. Read 5 tips for using AJAX in WordPress article for more details. What do you do when the user activates your … Read more
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
Well it can’t and won’t work like you want it to. Let’s look at what exactly are you doing. Inside your constructor you have: add_action(‘init’, array( &$this, ‘init’ ) ); //this doesn’t work So you add init method of your object to WPs init hook. When WP runs it’s init action, then your init method … Read more
This is invalid. PRIMARY KEY id (id) Should just be: PRIMARY KEY (id) Unlike other KEYs, PRIMARY KEYs don’t have identifiers or names. They don’t need them, because you can only have one.
settings_fields(‘bp_settings_group’); bp_settings_group should be changed to bp-settings-group to match. settings_fields( $option_group ) $option_group should match the group name used in register_setting() i.e bp-settings-group. check on codex here.
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
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