Retrieving plugin options value saved through setting

You are saving data to an option named my_option_name so your attempt to retrieve data from an option named $this->options[‘title’] isn’t going to work. You will need something like this: public function DataToget($field = ”) { if (empty($field)) return; $jugHigh = get_option( ‘my_option_name’ ); if (!isset($jugHigh[$field])) return; return $jugHigh[$field]; } With a shortcode like: if … Read more

Create a custom page template inside my wordpress plugin

You will create a page template whose file name is custompage-template.php here I suppose put in in your plugin dir/views/ folder. Whenever the page whose title is Your Page Name is visited, the site will render your custom template add_filter( ‘page_template’, ‘fw_reserve_page_template’ ); function fw_reserve_page_template( $page_template ) { if ( is_page( ‘Your Page Name’ ) … Read more

How to make Http Request to a php file present in plugin directory of wordpress

Here is a quick and dirty plugin that shows you how to achieve this (adapt this example to your own architecture and needs): <?php /* Plugin Name: Custom rewrite rule test */ add_action( ‘plugins_loaded’, array(Registration::get_instance(), ‘setup’) ); class Registration { protected static $instance = NULL; public function __construct() {} public static function get_instance() { NULL … Read more

Adding functions to hooks from within a class

I created a class instance and referenced that in add_action, which is moved below where the instance is created: if ( ! function_exists(‘add_action’) ) { header(‘Status: 403 Forbidden’); header(‘HTTP/1.1 403 Forbidden’); } if ( ! class_exists(‘My_Authentication’) ) { class My_Authentication { public function setup() { add_action(‘wp_login’, array(&$this, ‘no_auth_allowed’) ); add_action(‘wp_logout’, array(&$this, ‘no_auth_allowed’) ); } public … Read more

Add a row on clicking each post featured image

If you go with @Rituparna’s solution, try this: Don’t forget to add <a href=”#” class=”close”>X</a> in your container. jQuery(function($){ $(“.plink”).on(‘click’, function( event ){ event.preventDefault(); // cache the link clicked on var link = $(event.target); // use the link attr to target the desc var containerID = link.attr(‘href’); // get the description contained in the link … Read more