Support

Account

Forum Replies Created

  • Thank you John!!
    Using the current_filter() i’ve founded was i was doing wrong. The right one is:
    impostazioni-fashion_page_gestione-livelli-abbonamento

    Basically it doesn’t use the “menu_slug” but use “menu_title”. (Maybe is my fault because i’ve used two different names).

    Anyway thank you very much!

  • Hi John!

    Thank you for your reply, it is exactly what i was looking for. I’ve got a small question. If i use it on top level page, it works perfectly, but i can’t make it works with sub option page.

    My code is:

    
    
    if( function_exists('acf_add_options_page') ) {
    
        acf_add_options_page(array(
            'page_title' 	=> 'Impostazioni',
            'menu_title'	=> 'Impostazioni',
            'menu_slug' 	=> 'theme-trends-settings',
            'capability'	=> 'edit_posts',
            'redirect'	=> false
        ));
    
        acf_add_options_sub_page(array(
            'page_title' 	=> 'Forms',
            'menu_title'	=> 'Forms',
            'parent_slug'	=> 'theme-trends-settings',
        ));
    
        acf_add_options_sub_page(array(
            'page_title' 	=> 'Gestione livelli abbonamenti',
            'menu_title'	=> 'Gestione livelli abbonamenti',
            'parent_slug'	=> 'theme-trends-settings',
            'menu_slug'     => 'gestione-livelli-abbonamento'
        ));
    
    	add_action('theme-trends-settings_page_gestione-livelli-abbonamento', 'before_acf_options_page', 1);
    function before_acf_options_page() {}
    add_action('theme-trends-settings_page_gestione-livelli-abbonamento', 'after_acf_options_page', 20);
    function after_acf_options_page() {}
    
    

    What i’m doing wrong?
    Thank you

  • Founded the solution in ACF documentation.

    
    $medias = [23556,23586,23635];
    update_field('gallery', $medias, $post_id);
    
Viewing 3 posts - 1 through 3 (of 3 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.