Hot answers tagged

3

You can use following: update_option( 'show_on_front', 'page' ); update_option( 'page_on_front', '0' ); I hope this helps.


2

Given that you are dealing with email, I'd run wp_kses() with a very limited $allowed_html array similar to this sample from the Codex: array( 'a' => array( 'href' => array(), 'title' => array() ), 'br' => array(), 'em' => array(), 'strong' => array(), ); HTML rendering is even more squirrelly in email ...


2

If you want a quick programmatic way of looping through everything you have in the cron row inside wp_options and you have access to the site's database directly (either in a local development environment or on a webhost), you can run something like this via the command line: mysql $YOUR_DB_NAME -e "SELECT option_value FROM wp_options WHERE ...


2

$values = get_option( 'option_name') // Create array from string $values_array = explode( PHP_EOL, $values ); sort( $values_array ); // Create string from sorted array $sorted_values = implode( PHP_EOL, $values_array ); Read more about the sort function


2

If we check how the wp_options table is created (in 4.4) from the schema.php file, we will find the following: CREATE TABLE $wpdb->options ( option_id bigint(20) unsigned NOT NULL auto_increment, option_name varchar(191) NOT NULL default '', option_value longtext NOT NULL, autoload varchar(20) NOT NULL default 'yes', PRIMARY KEY (option_id), ...


1

I faced same type of issue when I imported my database via phpmyadmin. I think, if you have a database backup, then you can try another re-import operation vaia phpmyadmin. That worked for me, but not sure if that works for you.


1

If you import the database on your phpmyadmin. It has an option while importing sql files. Don't use AUTO_INCREMENT for null tables or zero rows. This option just above the go button. Read this checkbox and mark it based on your choice. Than import your database. It won't be the problem. The option_ID is an primary key and it's AUTO_INCREMENT. If ...


1

When your Cron array gets stuffed with more than one task, then there's a high chance, that you either forgot to check if there's already an unfinished task in the queue, or you have the config wrong. The config array gets used to ID a task in the queue. Meaning if you for e.g. have a typo or some other difference between wp_next_schedule() checks and ...


1

That entry is a PHP serialized array. The serialize method takes an array and stores it's value as a string so it can be stored elsewhere - like a database. In the above example, the "s:" entries stand for "string:". With a serialized array, each element's data type is represented by a letter (a, s, o, etc) followed by a colon, then an optional length, and ...


1

You have a free wordpress plugin made for that: Custom Post Type Permalinks Let us know if it is convenient


1

Your problem is that serialized strings contains escape slashes that are not evaluated as such, because the wrapping quote is a single quote. You are using: $v = 'a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}'; // wrong You have to use either $v = "a:2:{i:0;b:0;s:8:\"auto_add\";a:0:{}}"; // ok or $v = 'a:2:{i:0;b:0;s:8:"auto_add";a:0:{}}'; // ok By the ...



Only top voted, non community-wiki answers of a minimum length are eligible