How to make alert for new version on theme options?

see: http://clark-technet.com/2010/12/wordpress-self-hosted-plugin-update-api Basically the idea is to hook your update checking function to the pre_set_site_transient_update_themes filter. The version array key you return from this function will be compared by WP to the current theme version from style.css…. Use the admin_notices action to make your alert message more noticeable

WordPress: update_option, don’t update empty options?

More importantly, you should not let *untrusted, unsanitized $_POST data* into WordPress. But I think the issue is that you’re updating the option with the entire $_POST data, instead of the appropriate array key: update_option(‘eirepanel_inline_ads_options’, $_POST); Should probably be something like: update_option(‘eirepanel_inline_ads_options’, $_POST[‘eirepanel_inline_ads_options_name’]); Are your Plugin options discrete (one DB entry per option), or an … Read more

Theme options WP Editor

In theme options, I had to define wp_editor_settings. So, just in options.php, I used: //WP_editor settigs $wp_editor_settings = array( ‘wpautop’ => true, // Default ‘textarea_rows’ => 15, ‘tinymce’ => array( ‘plugins’ => ‘fullscreen,wordpress,wplink, textcolor’ )); Basically, I’m adding tinymce plugin.

WordPress Theme customisation CSS

I’ll describe what I did on a project recently that had similar requirements. First thing I did was bundle less.php in my theme and create a function to compile a .less file in my theme into CSS and return the result. It looked like this: function wpse_283711_get_customizer_css() { $css=””; if ( file_exists( get_theme_file_path( ‘customizer.less’ ) … Read more

WordPress Errors in generated by theme check plugin [closed]

File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls. The WordPress coding styles require that you make use of the WP Filesystem instead of using direct PHP file functions. You can replace your file_get_contents call easily with: $response = wp_remote_get($feed_url); $file_content = $response[‘body’]; For more specific infos just take a look … Read more

Setting up a members area

I’m in the process of establishing a members site. You can find a bunch of premium plugins to pay for…and a few free ones like s2member, Membership lite or Members. I decided to go with Members and write everything else i need (like paypal integration and so on) myself.

How to remove menus section from WordPress theme customizer

Try nav_menus instead of menus with remove_panel() function mytheme_customize_register( $wp_customize ) { //All our sections, settings, and controls will be added here $wp_customize->remove_section( ‘title_tagline’); $wp_customize->remove_section( ‘colors’); $wp_customize->remove_section( ‘header_image’); $wp_customize->remove_section( ‘background_image’); $wp_customize->remove_panel( ‘nav_menus’); $wp_customize->remove_section( ‘static_front_page’); $wp_customize->remove_section( ‘custom_css’); } add_action( ‘customize_register’, ‘mytheme_customize_register’,50 ); Hope this will helps you. Thank you!

Need help understanding/coding with Settings API

You have some of the callback functions and the ID’s mixed up, try this: add_action(‘admin_init’, function() { register_setting(‘elem_opts’, ‘elem_opts’, ‘elem_validate_opts’); add_settings_section(‘elem_opts_form1’, ‘Elements Theme Options’, ‘elem_opts_form’, ‘elem_opts’); add_settings_field(‘elem_opts_form’, ‘Facebook’, ‘elem_opts_social_fb_cb’, ‘elem_opts’, ‘elem_opts_form1’); }); function elem_opts_social_fb_cb() { $opts = get_option(‘elem_opts’); if (empty($opts) || !is_array($opts)) { $opts = array(); } ?> <input type=”text” name=”elem_opts[fb]” value=”<?php echo $opts[‘fb’] ? … Read more

Display user HTML on website

You may need to un-escape the output. Take a look at html_entity_decode or similar functions before outputting to the screen. $orig = “I’ll \”walk\” the <b>dog</b> now”; $a = htmlentities($orig); $b = html_entity_decode($a); echo $a; // I’ll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now echo $b; // I’ll “walk” the <b>dog</b> now html_entity_decode function MKWD_Display_Westmor_Bottom_Left() { $westmor_customers_options = … Read more

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