Problem escaping text which contains html markups

To escape html content you can use wp_kses function. $allowed = array( ‘li’ => array(), ‘a’ => array( ‘href’ => true, ), ); echo wp_kses(‘<li><a href=”#” target=”_blank”>Category</a></li>’, $allowed); If you do not want to pass allowed array you can use default WordPress array for post content which is used in wp_kses_post function. echo wp_kses_post(‘<li><a href=”#” …

Read more

Using function from enqueued .js file in theme in plugin?

Yes. Dependencies work across all of WP, it doesn’t matter where you enqueue your script. All that matters is that you define your dependencies correctly, and you’re doing that. If, however, you plan to publish both the theme and the plugin as standalone versions, you shouldn’t rely on your plugin being used with your theme, …

Read more

not getting API setting saved confirmation message after update on option page

You need the settings_errors(); function somewhere on your settings page: function display_acme_options_page() { settings_errors(); echo ‘<h2>Acme Options</h2>’; echo ‘<form method=”post” action=”options.php”>’; do_settings_sections( ‘acme-options-page’ ); settings_fields( ‘acme-settings’ ); submit_button(); echo ‘</form>’; }