WordPress postboxes On Tabbed Views and Hiding Registered Pages

You need something like the following: $metabox_array = array (array(‘view1’, ‘Metabox for View 1’, ‘Render View 1’, ‘Post’, ‘normal’, ‘default’, ‘view2’, ‘Metabox for View 2’, ‘Render View 2’, ‘Post’, ‘normal’, ‘default’, ‘view_x’, ‘Metabox for View_x’, ‘Render View_x’, ‘Post’, ‘normal’, ‘default’,)); function adding_custom_meta_boxes( $post ) { add_meta_box($metabox_array); } add_action( ‘add_meta_boxes_post’, ‘adding_custom_meta_boxes’ ); As kiaser states though, … Read more

How to work with AJAX and WordPress?

You’re not using wordpress default ajax mechanism. To do that: jQuery.ajax({ type: “POST”, url: “/wp-admin/admin-ajax.php”, // Send request to admin-ajax.php data: newcontact, // Can be anything. As per your need action: ‘myaction’, // Required to send otherwise WordPress AJAX won’t authorize your request. success: function(data) { jQuery(“.follow-user”).html(data); } }); AJAX Request Handler add_action( ‘wp_ajax_myaction’, ‘so_wp_ajax_function’ … Read more

edit-tags.php in plugin admin menu hides when is the active page

I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we’re only on the edit-tags page in the plugin if (‘edit-tags’ === $screen->base && ‘subscriber’ === $screen->post_type) { wp_enqueue_script( $this->plugin_slug . ‘-subscriber-edit-tags-script’, plugins_url(‘assets/js/subscriber-edit-tags.js’, __FILE__ ), … Read more

How to add chunk of php, html, and sql code to variable an append to $content

You appear to be quite close to having this all sorted out. If you wrap your queries in a function, and separate the logic and presentation: <?php function wpse_158425_get_terms(){ global $wpdb, $rpt_options; $wpdb->show_errors(); $rpt_days = $rpt_options[‘number_days’]; $rpt_term_ids = $wpdb->get_col(” SELECT term_id FROM $wpdb->term_taxonomy INNER JOIN $wpdb->term_relationships ON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id INNER JOIN $wpdb->posts ON $wpdb->posts.ID … Read more

Calling dynamic_sidebar in plugin gives error

it’s a little difficult to debug something when no errors are being displayed. i’d first check your php error logs, which normally appear in ….\logs\php_error.log or ….\logs\apache_erroe.log depending on your php.ini settings. chances of getting an immediate answer to your question will be difficult unless you can provide the actual error that’s popping up.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)