WordPress Plugin Tool Tip Helpers

What you’re looking for is called “pointers”, available since 3.3 and you’re right it lacks documentation. It’s done with a little bit of JavaScript. You may look at this post to find useful information about pointers. It uses native WP scripts and styles this way : wp_enqueue_style( ‘wp-pointer’ ); wp_enqueue_script( ‘wp-pointer’ ); See also this … Read more

Fullwidth slider using background image Flexslider WordPress

From WordPress 4.4 onwards, you can use the_post_thumbnail_url() inside The Loop to easily get the featured image source: <div style=”background-image: url(<?php the_post_thumbnail_url(); ?>);”> //Your html code </div> If you need compatibility with releases prior to the 4.4, wp_get_attachment_image_src() will do the work. Contrary to what its name suggests, it won’t return the image location directly, … Read more

Callback function quicktags that uses variable in start tag

Managed to find out how: function callback_wrap(e, c, ed) { var course = getSelectedText(“_lesson_course”); var module_info = jQuery(“#title”).val(); var module_nr = module_info.match( /\d+/g ); var start = ed.canvas.selectionStart; var end = ed.canvas.selectionEnd; var content = jQuery(“#content”).val(); console.log(start); console.log(end); console.log(ed); var selected = content.slice(start, end); var string = ‘<div class=”moudle-area”>’+selected+'<p>[Tweet “I just completed Module ‘+module_nr+’ of … Read more

WP Plugin: Print javascript in header

To only insert code into the header section in the admin area on single plugin pages you need to alter your add_action()function. add_action(‘admin_head-pageof_thisplugin/thisplugin’, ‘thisplugin_adminhead’); function thisplugin_adminhead() { // here goes your content echo ‘<script>’ .’/* … */’ .'</script>’; } where pageof_thisplugin/thispluginis the hook slug that returns out of the function that creates your page like … Read more