How to save plugin custom settings page fields

Something was wrong with the naming, I had to change the field names, and it works ok. From your code sample, this: add_settings_field( ‘frontend-font’, // id attribute of tag __(‘بارگذاری فونت برای بخش اصلی سایت’, ‘persianfont’), // Title as lable for field function(){ var_dump(get_option( ‘persianfont’ )); //$check_frontend_font = is_null(get_option( ‘persianfont’ )[‘frontend-font’]) ? ‘true’ : get_option( … Read more

plugin enqueue style on all pages

You’re enquing on the admin_enqueue_scripts hook, which is why it’s only showing up on admin pages If we look at an example from the official documentation: /** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, … Read more

Update WP option by plugin

That option is special in that WordPress has code to intercept your call for security reasons: https://codex.wordpress.org/Function_Reference/update_option_new_admin_email This function intercepts changes to the administrator’s email address. It keeps the address from being updated and instead sends the user a confirmation email, with a link to confirm the change. What you’re trying to do could be … Read more

How to get a list of all the available plugins names

You can use this URL to run GET request: https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[page]=2&request[per_page]=100&request[browse]=new You will get JSON object that includes plugins, the total number of plugins, page, the total number of pages. It will sort plugins from newest to oldest.