Creating Custom Hook for my plugin

First, register the filter hooks with the handy apply_filters tool: function wpse_238394_org_types() { return apply_filters( “my_org_types”, array( “affiliate”, “direct”, “bureau” ) ); } Now, wpse_238394_org_types() will return the default 3 types being not filtered yet, so we one more custom type: add_filter(“my_org_types”, function($types) { $types[] = “custom_type”; return $types; }); Now if you debug wpse_238394_org_types() … Read more

Where to store media uploaded by the plugin?

You can do something like this to create your own plugin upload folder in /wp-content/uploads the following code will basically create a custom folder inside uploads called myplugin_uploads and put an empty index.html inside it. Dynamically creating your custom upload folder add_action( ‘init’, ‘create_files’ ); function create_files() { $upload_dir = wp_upload_dir(); $files = array( array( … Read more

ACF Repeater Field Question [closed]

You should have to create a sub repeater field(lets call box_service) inside the repeater field services_sections. Then create the sub fields (services_icon, service_title, services_description )inside box_service repeater field. (please check attachment)) then use below code : <section class=”services cf”> <div class=”wrapper”> <?php if( have_rows(‘services_sections’) ): while( have_rows(‘services_sections’) ): the_row(); ?> <div class=”service”> <?php if( have_rows(‘box_service’) … Read more