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 | |
/** | |
* Exclude posts with empty post_content from search results | |
*/ | |
function modify_search_query( $query ) { | |
// Check if this is a search query and not an admin query | |
if ( $query->is_search() && ! is_admin() ) { | |
// Add a filter to exclude posts with empty post_content | |
add_filter( 'posts_where', 'exclude_empty_post_content' ); |
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 | |
/** | |
* Plugin Name: Client Role Plugin | |
* Plugin URI: https://gist.github.com/philhoyt/54a4a4e5a48d8cb0beb20edf1ba1ae51 | |
* Description: Adds a 'Client' user role and revokes certain capabilities from it. | |
* Version: 1.0.0 | |
* Author: Your Name | |
* Author URI: https://philhoyt.com/ | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
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
<script id="tmpl-nf-field-submit" type="text/template"> | |
<a id="nf-field-{{{ data.id }}}" class="btn {{{ data.renderClasses() }}} nf-element " target="_self" href="#"> | |
<span class="btn-content">{{{ data.label }}}</span> | |
<span class="icon"><i class="fa fa-arrow-right" aria-hidden="true"></i></span> | |
</a> | |
</script> |
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
add_filter( 'ninja_forms_field_template_file_paths', 'custom_field_file_path' ); | |
function custom_field_file_path( $paths ){ | |
$paths[] = get_stylesheet_directory() . '/ninja-forms/templates/'; | |
return $paths; | |
} |
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
/** | |
* Adds a meta box | |
*/ | |
function simple_meta_box() { | |
add_meta_box( 'prfx_meta', ( 'View Post' ), 'simple_meta_box_callback', 'staff', 'side', 'high' ); | |
} | |
add_action( 'add_meta_boxes', 'simple_meta_box' ); | |
/** | |
* Outputs the content of the meta box |
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 | |
/** Create Title and Slug */ | |
function acf_title( $value, $post_id, $field ) { | |
if ( get_post_type( $post_id ) === 'staff' ) { | |
$new_title = get_field( 'first_name', $post_id ) . ' ' . $value; | |
$new_slug = sanitize_title( $new_title ); | |
wp_update_post( | |
array( |
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
/** | |
* Register custom fonts. | |
*/ | |
function themeslug_fonts_url() { | |
$fonts_url = ''; | |
$fonts = array(); | |
$subsets = 'latin,latin-ext'; | |
/* | |
* Translators: If there are characters in your language that are not supported |