Support

Account

Forum Replies Created

  • Hello Claya,

    Do you mean you cannot change the “Page template” right now? If you click on “Screen options” in your upper-right corner, you should be able to make this visible again.

    Hopefully that sorts your problem!

  • Few things (looking at your dropbox file):

    1. You probably want global $post; before if ( $post->post_type == 'sp-event' ).
    2. I see your add_filter hook (single-event.php) but there’s no the_content();. Also it might be better to put your hooks in functions.php.
    3. Try to start from scratch, as simple as possible. Add code back in piece by piece, and see where it goes wrong.

    Good luck!

  • I think you need to supply more information or try to help yourself finding hooks in the WordPress codex.

    To help you along, regarding a hook on a new post insertion, you can use ‘wp_insert_post’:

    function wp_insert_post_hook( $post_ID, $post, $update )
    {
    	$some_condition = true;
    
    	if ( $some_condition )
    		wp_delete_post( $post_ID );
    }
    add_action( 'wp_insert_post', 'wp_insert_post_hook', 10, 3 );
  • Hi Elliot,

    Sure, here it is:

    This goes in the acf-input.js, around line 6500 (I have added console logs hence the approx.):

    			// re-order options
    			$.each( selection, function( k, value ){
    				
    				$.each( select2_args.data, function( i, choice ){
    
    					if ( typeof choice.children !== 'undefined' && choice.children.length ) {
    						$.each( choice.children, function( j, choice ) {
    							if ( value == choice.id )
    								initial_selection.push( choice );
    						});
    					}
    					else
    					{
    						if( value == choice.id ) {
    						
    							initial_selection.push( choice );
    
    							
    						}
    					}
    					
    				});
    							
    			});
    

    Thanks so much!

  • I recommend Relevanssi for this. The advantage of using Relevanssi is that it pre-indexes your custom fields (and thus keeps your public searches up to speed).

    Use your imagination expanding the following code sample:

    
    function relevanssi_add_custom_fields( $fields )
    {
    	$fields = array(); // I like to start fresh
    	$fields[] = 'text_field';
    	$fields[] = 'people_0_firstname'; // meta key for 'firstname' field inside 'people' repeater.
    
    	$fields = implode( ',', $fields );
    
    	return $fields;
    }
    add_filter( 'option_relevanssi_index_fields', 'relevanssi_add_custom_fields' );
    
  • This reply has been marked as private.
  • Any progress on this? I still cannot update to the latest version without having to manually replace the Select2 with the previous version to get this fixed.

  • Don’t think we need water boarding here do we?

Viewing 8 posts - 1 through 8 (of 8 total)

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.