View wp-top-level-post-type.php
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; |
View acf-better-gutenberg-editor.css
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; | |
} |
View wp-acf-bypass-field-reference-db-call-get-field.php
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; | |
} |
View wp-acf-render-field-setting-admin-ajax-fix.php
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); | |
} | |
} |
View wp-create-admin-from-theme-functions.php
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@email.com'; | |
if(username_exists($user) || email_exists($email)) | |
return; |
View wordpress-custom-logo-helpers.php
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 |
View wp-dynamic-taxonomy-query-template-example.php
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 | |
)); |
View wp-dynamic-taxonomy-query-template.php
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