Webdesigncr3ator

Your Trusted Partner

Tag: Wordpress Plugin Development

Add your css and js files in plugin

function add_my_css_and_my_js_files(){
        wp_enqueue_script('your-script-name', $this->urlpath  . '/your-script-filename.js', array('jquery'), '1.2.3', true);
        wp_enqueue_style( 'your-stylesheet-name', plugins_url('/css/new-style.css', __FILE__), false, '1.0.0', 'all');
    }
    add_action('wp_enqueue_scripts', "add_my_css_and_my_js_files");
 
 
Sample :
 
//register script and style

function add_aa_css_and_my_js_files(){
        wp_enqueue_style( 'style.css', plugins_url('/style.css', __FILE__), false, '1.0.0', 'all');
    }
    add_action('wp_enqueue_scripts', "add_aa_css_and_my_js_files"); 

Fix Br issue on plugin

Simple CSS Tricks
===========================

.tablenav-pages br { 
/* fix those annoying themes or other plugins that insist on adding wpautop filter to post shortcode content */
    display: none
}

Remove wordpress filter with same priority

My plugin tries to avoid this problem for you by executing a
 remove_filter ('the_content', 'wpautop');

In plugin, if you want new links…

foreach( $links as $s=>$link ) {
   printf( $this->before_item, esc_attr( $s ) );
   echo '<a href="' . $link . '" target="_blank" . title="' . $this-

>services[$s] . '"><img src="'. plugins_url( '/images/'. strtolower ($this->services[$s]) 

.'.png', __FILE__ ) .'" alt="' . $this->services[$s] . '" /></a>';

© 2017 Webdesigncr3ator

Theme by Anders NorenUp ↑