• Resolved Dennis Rasmussen

    (@dennisras)


    Hey there,
    Great plugin as usual ??

    Do the Depicter sliders register as a post type?

    We are unable to select Depicter sliders as a post type when combined with other plugins such as the prominent Advanced Custom Fields plugin. See screenshot below:

    This is the case for all ACF Field Types (Post Object and Relationship).

    If Depicter doesn’t use WordPress post types for its sliders, may I suggest as a new feature that Depicter detects ACF being installed and registers as a Field Type option in ACF (SmartSlider3 does this) ??

    Thanks for your time.
    Edit: Added links for references.

    • This topic was modified 1 year, 8 months ago by Dennis Rasmussen. Reason: Added links for references
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Dennis Rasmussen

    (@dennisras)

    Hacky solution for now ??

    add_action('init', function () {
        if (!function_exists('acf_register_field_type') || !function_exists('depicter')) {
            return;
        }
    
        class acf_field_depicter extends \acf_field
        {
            public function __construct()
            {
                $this->name = 'DEPICTER';
                $this->label = 'Depicter';
                $this->category = 'relational';
                parent::__construct();
            }
    
            public function render_field($field)
            {
                global $wpdb;
                $sliders = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}depicter_documents WHERE parent = 0 ORDER BY name ASC");
                $options = array('<option value=""></option>');
                foreach ($sliders as $slider) {
                    $options[] = sprintf('<option value="%s" %s>%s</option>', $slider->id, $field['value'] == $slider->id ? 'selected' : '', $slider->name);
                }
    
                echo sprintf(
                    '<select name="%s" id="%s" class="components-select-control__input">
                        %s
                    </select>',
                    esc_attr($field['name']),
                    esc_attr($field['id']),
                    implode('', $options)
                );
            }
        }
    
        acf_register_field_type('acf_field_depicter');
    });
    
    Plugin Author averta

    (@averta)

    @dennisras
    Hi. ?Thank you for sharing your workaround. ? ?The Depicter does not support ACF officially yet but we will add this in near future updates. We have noted your code and all the details and your feedback is much appreciated.

    Plugin Author averta

    (@averta)

    @dennisras
    Hi there, we released an update yesterday and now you can use ACF as well.
    Please give it a try and let us know what you think about it

    Thread Starter Dennis Rasmussen

    (@dennisras)

    Hi there @averta,

    Thanks for your follow-up.
    I just updated and tested and I don’t see Depicter as a field type in the ACF editor.

    Maybe there was a misunderstanding?
    Please take a look in my first post ??

    Plugin Author averta

    (@averta)

    @dennisras
    Hi our old friend,
    ?I’m glad to say that the Depicter now fully supports ACF. If you are using the free version of the Depicter, you can use the custom fields that you have added to your blog posts in your sliders. ?Other data sources including Woocommerce products and “Custom post type” added by ACF are available in the Depicter Pro.

    Please let me know if you have any suggestions about ACF support.

    Thread Starter Dennis Rasmussen

    (@dennisras)

    Hi again?@averta ??

    Thank you for the reply.
    I think you misunderstand what I’m trying to say in this topic.

    It’s great that you now have ACF support inside Depicter. Well done!
    But my issue is that you can’t find Depicter sliders inside the ACF plugin.

    In ACF you can select posts, pages and other post types for field relationships, but you can’t select Depicter sliders, because Depicter does not use WordPress post types for its sliders.

    If you take a look at the first picture of this topic, you can see a screenshot of the field option where you can select posts, pages, forms and other custom post types, but you can’t select Depicter. Other Slider/Slideshow plugins have this kind of support (like SmartSlider3).

    I provided an example code above also, which makes this work inside ACF so you can select a Depicter slider in related field options.

    I hope this clarifies it all ??

    Is there a work around for Crocoblock as for ACF?

    I have made a post type with jetengine and added a field which is called “VIDEO”. I would very much like to be able to use that video in the post for the background video in a Depicter slide.

    • This reply was modified 1 year, 5 months ago by mix25.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can’t use Depicter together with ACF’ is closed to new replies.