Modify php code from plugin

Given that there are no filters in the theme that you could manipulate, this is a bit tougher but you can alter the logout URL in general with the logout_url filter: function hack_logout_url_wpse_193113($logout_url, $redirect) { $logout_url = parse_url($logout_url); if (!empty($logout_url[‘query’])) { parse_str(html_entity_decode($logout_url[‘query’]),$qry_str); $qry_str[‘redirect_to’] = urlencode(home_url()); } $logout_url[‘query’] = build_query($qry_str); $ret=””; foreach ($logout_url as $k=>$v) { … Read more

Modify a plugin’s content

You don’t echo content from a filter, you return it. You should have: function addOptions($post_id){ $post = get_post($post_id); return $post_id; } add_filter(‘mbdb_book_grid_after_link’,’addOptions’); See: https://wordpress.stackexchange.com/a/113760/21376

how to create table during plugin installation in side a class

You should run your register_activation_hook after creating object. class Notification { function jal_install() { global $wpdb; global $jal_db_version; $table_name = $wpdb->prefix . ‘fnotice’; $charset_collate = $wpdb->get_charset_collate(); $sql = “CREATE TABLE $table_name ( id INT NOT NULL AUTO_INCREMENT, msg varchar(500) NOT NULL, time DATETIME NOT NULL, type varchar(350) NOT NULL, link varchar(350) NOT NULL, status ENUM(‘0’, … Read more

Javascript not working

wp_ajax_{my-action} action hook is only for admin side. For frontend you must use wp_ajax_nopriv_{my-action}. You can combina both if the ajax action is for both sides. For example: add_action(‘wp_ajax_filter_search’, ‘filter_search_result’); add_action(‘wp_ajax_nopriv_filter_search’, ‘filter_search_result’); Also, don’t forget, never, to die or exit at the end of the ajax action because the program is not closed by WordPress … Read more