WordPress get_option() on AJAX issue

Well, for anyone that might need this in the future. Woocommerce overrides the get_option() method with this line: add_filter(‘option_woocommerce_currency_pos’, array($this, ‘filter_currency_position_option’)); Which then calls filter_currency_position_option The first few lines of this method are: function filter_currency_position_option($value){ global $pagenow; if( ( is_ajax() || ( $pagenow == ‘post-new.php’ && isset( $_GET[‘post_type’] ) && $_GET[‘post_type’] == ‘shop_order’ ) ) … Read more

403 error on submit at the plugin options page

I have solved this by adding the word “content” to the field name <textarea rows=”5″ cols=”20″ name=”ad1_content”><?php echo stripslashes( get_option(‘ad1_content’) )?></textarea> It then worked just fine I think this is a security issue that accepted the script tag for fields containing content (used by wordpress in editor by the way) in name and rejecting the … Read more

how create an html table with all values from a serialized array in option_value

Don’t know how you stored your data. Just answering from assumption: <?php $options = get_option(‘all_names’); ?> <table> <tbody> <?php $_counter = 0; foreach( $options as $option ) : ?> <tr> <td><?php echo $option[‘block1_names_arr’][$_counter]; ?></td> <td><?php echo $option[‘block2_names_arr’][$_counter]; ?></td> </tr> <?php $_counter++; endforeach; ?> </tbody> </table>

How to use update_option() without replacing/losing the old value?

Use update_option() in conjunction with get_option(): $old_option = get_option(‘blogdescription’); $new_option = ‘My new blog description’; $new_option .= $old_option; // This is the same as $new_option = $new_option . $old_option; update_option(‘blogdescription’, $new_option); If they are integers, obviously use something like $new_option += $old_option.

Block properties, attributes and settings

Settings is what you define in registerBlockType() in the block.js file. Here you have to add most basic settings like title:, category: and icon:. (Handbook link). Attributes are optional, also in registerBlockType(). You can extract values from markup i.e. for saving the block content (Handbook link). Properties get passed from the editor. You can find … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)