OOP development and hooks

Sally CJ raises a good point in their comment that it is probably better to have each class initialize its own actions and filters. I’ve been working with the same boiler plate for some time now and created my own version of this boiler plate on GitHub. In that version I have a Back\Hooks and … Read more

Change Label of custom post type

The list_table_primary_column hook might be the one to go with, i.e: add_filter(‘list_table_primary_column’, ‘teams_table_primary_column’, 10, 2); function teams_table_primary_column($colname, $screen_id) { if($screen_id == ‘teams’ && $colname == ‘Title’) { return “New column name”; } } Note: this is completely untested, let me know how it goes! Reference

ajax multiple Values

Thanks to give me the advise to work with JSON. I Think i get it now. Perhaps someone could look over it? Here My Code Button: <div id=”div3″> <button id=”rob-wp-ajax-vorlage-button”>ok</button> </div> My PHP Code function load_my_ajax_vorlage() { wp_enqueue_script( ‘my_custom_js’, plugins_url( ‘ajax-vorlage-script.js’, __FILE__ ), array(‘jquery’), false, false ); } add_action(‘wp_enqueue_scripts’, ‘load_my_ajax_vorlage’); add_action( ‘wp_footer’, ‘load_my_ajax_vorlage’ ); add_action(‘wp_enqueue_scripts’, … Read more

Store admin page into variable

In case something like this would ever need to somebody, I solved pinging the page with an AJAX request $.ajax({ url: ‘your_url_to_ping’, beforeSend: function(xhr) { //something } }).done(function(data) { //something else with your data }); The page would be into your response data.