[venues] custom editor style template

WordPress Event Management, Calendars & Registration Forums General Question [venues] custom editor style template

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 10 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7234

    Hi, Stephen.
    What if i need custom editor style template for venue creating? For example – load some html tags or user?
    I`ve tried to get this feature by $current_screen => [parent_file] => edit.php or [action] => create, inside your plugin files, and even made it, but then i cant get existing metadata of venue. Only my custom editor style showing. How can i deal with it? (Hope you will understand and fogrive me for my english 🙂 )

    Iurii Smuglov
    #7243

    Hi lurii, could you post (or pastebin / gist) some code, I’m not quite sure you what you’re trying to do? You can get the venue slug via $_GET if that helps, then you can get the venue ID from: $venue = eo_get_venue_by( 'slug', $venue_slug );, (see codex)

    Stephen Harris
    #7271

    Ok, will try to explain you what i mean 🙂
    I need preload some html tags into Venue editor field.
    Here is the way, which i use to do it with Events in functions.php:
    http://pastebin.com/VEr7a91v

    But the point is i don’t know how to do it with Venues.

    I`ve tried edit event-organiser-venues.php with if ( $current_screen->action == ‘create’), but no effect: http://pastebin.com/PJa6CZ7N

    Iurii Smuglov
    #7316

    Hi Lurii, the following should work:

    add_filter( 'the_editor_content', 'custom_editor_content' );
    function custom_editor_content( $content ) {
    
        $screen = get_current_screen();
    
        if ( empty( $content ) && $screen->id == 'event_page_venues' && $_GET['action'] == 'create' ){
            $content = 'Default text...';
        }
    
        return $content;
    }
    
    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.