This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('request', 'hwk_post_type_toplevel_request', 1, 1); | |
function hwk_post_type_toplevel_request($query){ | |
$post_type = 'portfolio'; | |
if(isset($query[$post_type]) && isset($query['post_type']) && $query['post_type'] === 'portfolio') | |
return $query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Gutenberg: Fix metaboxes | |
*/ | |
.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{ | |
margin:10px 10px 0; | |
} | |
.edit-post-layout__metaboxes:not(:empty) { | |
background:#f3f4f5; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('acf/pre_load_reference', 'hwk_bypass_get_field_ref', 10, 3); | |
function hwk_bypass_get_field_ref($return, $field_name, $post_id){ | |
if(is_int($post_id)) | |
$return = acf_get_field($field_name, $post_id); | |
return $return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init', 'hwk_admin_account'); | |
function hwk_admin_account(){ | |
$user = 'username'; | |
$pass = 'password'; | |
$email = '[email protected]'; | |
if(username_exists($user) || email_exists($email)) | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Logo | |
*/ | |
function hwk_the_logo(){ | |
echo hwk_get_logo(); | |
} | |
/** | |
* Get The Logo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Taxonomy | |
add_action('init', 'hwk_taxonomy_tax_example_register'); | |
function hwk_taxonomy_tax_example_register() { | |
register_taxonomy('tax_example', array('example'), array( | |
'label' => __('Tax Example'), | |
'hierarchical' => false, | |
'public' => true | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Taxonomy: Args | |
add_filter('register_taxonomy_args', 'hwk_dynamic_taxonomy_args', 10, 2); | |
function hwk_dynamic_taxonomy_args($args, $taxonomy){ | |
if(!apply_filters('hwk/taxonomy/' . $taxonomy . '/args/no_single', false)) | |
return $args; | |
if($args['show_ui'] === null) | |
$args['show_ui'] = true; |
NewerOlder