Client work
A Pen by Greg Sweet on CodePen.
Client work
A Pen by Greg Sweet on CodePen.
| <?php | |
| function is_user_logged_in() { | |
| $loggedin = false; | |
| foreach ( (array) $_COOKIE as $cookie => $value ) { | |
| if ( stristr( $cookie, 'wordpress_logged_in_' ) ) { | |
| $loggedin = true; | |
| } | |
| } | |
| return $loggedin; | |
| } |
| <?php | |
| # Register custom post types on the 'init' hook. | |
| add_action( 'init', 'my_register_post_types' ); | |
| /** | |
| * Registers post types needed by the plugin. | |
| * | |
| * @since 1.0.0 | |
| * @access public |
| <?php | |
| /** | |
| * @func acfw_location_rules | |
| * Return an array of rules for use with register_field_group() 'location' key | |
| * @param array $a | |
| * @param str $param | |
| * @param str $operator | |
| * @param bool $extended | |
| */ | |
| function acfw_location_rules( array $a, $param, $op, $extended = false ){ |
| $.extend({ | |
| replaceTag: function (element, tagName, withDataAndEvents, deepWithDataAndEvents) { | |
| var newTag = $("<" + tagName + ">")[0] | |
| // From [Stackoverflow: Copy all Attributes](http://stackoverflow.com/a/6753486/2096729) | |
| $.each(element.attributes, function() { | |
| newTag.setAttribute(this.name, this.value); | |
| }); | |
| $(element).children().clone(withDataAndEvents, deepWithDataAndEvents).appendTo(newTag) | |
| return newTag | |
| } |
| <?php | |
| /* | |
| ############################## | |
| ########### Search ########### | |
| ############################## | |
| Included are steps to help make this script easier for other to follow | |
| All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10 | |
| [list_searcheable_acf list all the custom fields we want to include in our search query] | |
| @return [array] [list of custom fields] |