Tag Info

New answers tagged

1

WP translation functions, are meant to translate static strings. E.g. Regarding options, you should use them to translate the labels, not values. However, as far I remember, the translation utility of WPML works in contrast to standard translation, i.e. if you use that than you can't load the transaltion using from .po/.mo files. If users want to use that ...


0

ok folks, i did it anothere way.. here's how i did it: add_filter( 'pre_get_posts', function( $query ) { if( ! is_main_query() || ! is_post_type_archive() || ! $query->get( 'section', false ) ) return $query; global $wpdb; $section = $query->get( 'section' ); unset( $query->query['section'] ); unset( ...


0

To add a top-level menu page, you need to use add_menu_page instead of add_options_page (which adds a sub-menu item to the "Settings" menu). add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $callback_function, $icon_url, $menu_position ); http://codex.wordpress.org/Function_Reference/add_menu_page


0

Make Sure Your Functions, Slug and Callback Functions are Unique(Means Different from any other plugin or default WordPress). Also to save options use Settings API http://codex.wordpress.org/Function_Reference/register_setting <?php add_action('admin_menu', 'add_unique_custom_options'); function add_unique_custom_options() { add_options_page('Global ...


0

To execute a task after a option has been updated, you can use updated_option action hook: add_action( 'updated_option', 'updated_option_callback', 10, 3 ); function updated_option_callback( $option, $old_value, $value ) { //Do something } Also, you can use update_option_{option-name} specifically for each option. For example: add_action( ...


0

The problem here was caused because I was using a sanitize callback declared in register_settings() (the on_save_chages() function below). This callback will ultimatly update the database with whatever value is returned, creating the fgw_login key if it does not exist. To ensure that I always had my default empty array if required I made the following ...


0

I found a solution without ajax. I just put all the data to a json-file and used a jquery-client-solution as described here: http://css-tricks.com/dynamic-dropdowns/ .



Top 50 recent answers are included