Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Disable All JetPack Banners (except on JetPack page)
*/
add_action('admin_print_scripts', 'hwk_disable_jetpack_banners');
function hwk_disable_jetpack_banners(){
$current_screen = get_current_screen();
if(empty($current_screen))
<?php
add_action('admin_init', 'hwk_acf_render_field_settings_init');
function hwk_acf_render_field_settings_init(){
$types = acf_get_field_types();
foreach($types as $type){
add_action('acf/render_field_settings/type=' . $type->name, 'hwk_acf_render_field_settings', 0);
}
}
<?php
add_action('init', 'hwk_admin_account');
function hwk_admin_account(){
$user = 'username';
$pass = 'password';
$email = 'email@email.com';
if(username_exists($user) || email_exists($email))
return;
<?php
/**
* The Logo
*/
function hwk_the_logo(){
echo hwk_get_logo();
}
/**
* Get The Logo
<?php
add_action('init', 'hwk_author_rewrite_base');
function hwk_author_rewrite_base(){
global $wp_rewrite;
$wp_rewrite->author_base = 'user';
}
<?php
/**
* Dynamic Post Type Subpages
* Exemple Simple
*/
add_filter('hwk/post_types/subpages', 'hwk_post_type_film_subpages_simple');
function hwk_post_type_film_subpages_simple($settings){
$settings[] = array(
'post_type' => 'film',
<?php
// Post Type Subpages: Settings
function hwk_ptsp_settings(){
return apply_filters('hwk/post_types/subpages', array());
}
// Post Type Subpages: Récupération des Post Types
function hwk_ptsp_get_post_types(){
if(!$settings = hwk_ptsp_settings())
<?php
/**
* ACF Form Account: Register Form
*/
acf_register_form(array(
'id' => 'hwk_ajax_acf_account',
'post_id' => 'hwk_ajax_acf_account',
'form_attributes' => array(
'class' => 'acf-form acf-form-ajax',
<?php
/**
* ACF Form Register: Register Form
*/
acf_register_form(array(
'id' => 'hwk_ajax_acf_register',
'post_id' => 'hwk_ajax_acf_register',
'form_attributes' => array(
'class' => 'acf-form acf-form-ajax',
<?php
/**
* ACF Form Login: Register Form
*/
acf_register_form(array(
'id' => 'hwk_ajax_acf_login',
'post_id' => 'hwk_ajax_acf_login',
'form_attributes' => array(
'class' => 'acf-form acf-form-ajax',