Skip to content

Instantly share code, notes, and snippets.

View agrogeek's full-sized avatar

Sebas MGC agrogeek

View GitHub Profile
@agrogeek
agrogeek / admin_head_post_edit_check.php
Last active April 28, 2020 14:19 — forked from petenelson/admin_head_post_edit_check.php
WordPress admin action hooks for listing/adding/editing posts or pages
/* actions fired when listing/adding/editing posts or pages */
/* admin_head-(hookname) to head include */
/* admin_footer-(hookname) to footer include */
add_action( 'admin_head-post.php', 'admin_head_post_editing' );
add_action( 'admin_head-post-new.php', 'admin_head_post_new' );
add_action( 'admin_head-edit.php', 'admin_head_post_listing' );
function admin_head_post_editing() {
echo 'you are editing a post';
}
@agrogeek
agrogeek / exemple.php
Created April 29, 2020 14:11 — forked from willybahuaud/exemple.php
wp_dropdown_category multiple
<?php
wp_dropdown_categories( array(
'taxonomy' => 'category',
'multiple' => true,
'walker' => new Willy_Walker_CategoryDropdown(),
'selected' => array( 10, 12 ), // selected terms…
'hide_empty' => false,
) );