Articles of plugins

Using $wpdb in a plugin, what sort of data does it return?

I have following code: <?php $q = intval($_GET[‘q’]); global $wpdb; $myoption = get_option( ‘fixformdata_options’ ); $myoptionValue = maybe_unserialize( $myoption ); $result2 = $wpdb->get_row ( $wpdb->prepare ( “SELECT * FROM {$myoptionValue[‘tablename’]} WHERE personeelsNummer = %d”, $q ) ); if($result2) { echo json_encode( $result2 ); } ?> I get the following error: SyntaxError: JSON.parse: unexpected character at […]

Hook on creating a menu entry?

I need to run some code after a new item has been inserted into a WordPress nav menu. Is there any hook on menu modification or something similar?

Plugin hook not working on specific WordPress installation – how to troubleshoot?

I’m trying to write a simple text replacement plugin, but I’m having an issue that I can’t figure out how to troubleshoot. This is the test plugin I’m using as a starting point. It works fine on one WordPress installation running locally (installation A), but on another local installation (installation B), it has no effect […]

WordPress's is_plugin_active_for_network function not working for multisites

I am in need to do some operation if user clicks on Network Activate button on my WP Plugin (in WP Multisite). But I noticed that WordPress’s is_plugin_active_for_network function not working for multisites when I press the Network Activate button from the Main Administrator Panel. It returns nothing, and hence the if(is_plugin_active_for_network(‘abc/abc.php’)) is not fulfilled. […]

Help with a function in a widget

I’m new to custom widgets and functions, and need a bit of help understanding how to achieve something. On my bookstore site I need to display links to books on external site using their ISBN numbers. I’m already getting their Google Books preview with a function in my theme’s functions.php, but now I want to […]

Fetch CSS of posts

I am using JSON API plugin for fetching recent posts.Now I want to show them in my web as they are being displayed in wordpress.How can i get css of wordpress theme?

Embed PDF into wordpress

is there’s a way to show a PDF file inside Post in wordpress ? i used tag but if someone have Internet Download Manager , Dialog will appear to Download the PDF file if visitor click cancel they will not be able to see it ONLY download it so is there’s a way to Stop […]

Give access of horizontal scroling plugin to user role editor

How do i give access to user role editor without using any plugin using bellow function function HSA_add_to_menu() { add_options_page(‘Horizontal scrolling announcement’, __(‘Horizontal Scrolling’, WP_hsa_UNIQUE_NAME), ‘manage_options’, ‘horizontal-scrolling-announcement’, ‘HSA_admin_options’ ); }

Call another page in forms

I am doing some practice for WordPress plugin. In plugin I am working on a form and what I need is to call another page on submission. I have tried that but nothing seems to work. <form method = “Post” action = “some_file.php”> </form>

Posts to have category specific sidebars with the widgets

I’m using the Divi theme to build my website.My client wants News and Blog page on the same site, so I did this by using categories. My problem is how to achieve category(i.e News and Blog) specific sidebars? By default, posts uses the default sidebars. I set the default sidebar to my Blog page. I’ve […]