Support Forum » User Profile

Forum Replies Created

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • in reply to: Disappearing custom post fields #41749
    Way LeongWay Leong
    Participant

    Hi,

    I am encountering the same issue as Pat. I was renaming my Custom Post Group Name Title without touching the ID but my CPTs went missing, but the DB still saves the data.

    This is a bit frustrating as it happened to me a few times while renaming the title, has the problem been resolved?

    Way LeongWay Leong
    Participant

    Hi Peter,

    Sorry for repeating this over again but I promise this would be the last.

    
    add_filter( 'rwmb_frontend_dashboard_query_args', 'my_frontend_dashboard_query_args' );
    function my_frontend_dashboard_query_args( $args ) {
        $args['post_status'] = array( 'publish', 'trash' ); // Include trashed posts in the query
        return $args;
    }
    
    add_filter( 'wp_trash_post_status', 'my_trash_post_status', 10, 2 );
    function my_trash_post_status( $trash_status, $post ) {
        $allowed_post_types = array( 'post','newsroom', 'property', 'leadership', 'company' ); // Set allowed post types
        if ( in_array( $post->post_type, $allowed_post_types ) ) {
            $trash_status = 'auto-draft'; // Set trashed posts to auto-draft status
        }
        
        return $trash_status;
    }
    
    add_action( 'rwmb_frontend_after_delete_post', 'my_frontend_restore_post_status', 10, 2 );
    function my_frontend_restore_post_status( $post_id, $post ) {
        if ( $post->post_status === 'trash' ) {
            $allowed_post_types = array( 'post','newsroom', 'property', 'leadership', 'company' ); // Set allowed post types
            if ( in_array( $post->post_type, $allowed_post_types ) ) {
                wp_update_post( array( 'ID' => $post_id, 'post_status' => 'draft' ) ); // Restore trashed posts to draft status
            }
        }
    

    I tried to enable allowed edit for deleted post but the code doesn't seem working and it will still the same as this photo (https://prnt.sc/krDt4y39ovz8). Could you guide me on which PHP function is the correct one to allow deleted post to be edit?

    Way LeongWay Leong
    Participant

    Hi, I applied the following php code into code snippets

    <?php
    
    add_filter( 'rwmb_frontend_dashboard_query_args', 'my_frontend_dashboard_query_args' );
    function my_frontend_dashboard_query_args( $args ) {
        $args['post_status'] = array( 'publish', 'trash' ); // Include trashed posts in the query
        return $args;
    }
    
    add_filter( 'wp_trash_post_status', 'my_trash_post_status', 10, 2 );
    function my_trash_post_status( $trash_status, $post ) {
        $allowed_post_types = array( 'post','newsroom', 'property', 'leadership', 'company' ); // Set allowed post types
    
        if ( in_array( $post->post_type, $allowed_post_types ) ) {
            $trash_status = 'auto-draft'; // Set trashed posts to auto-draft status
        }
        return $trash_status;
    }

    It does display the trashed post on the Frontend dashboard, but I am unable to edit the post even my user role is Admin. You may view the image here (https://prnt.sc/krDt4y39ovz8)

    I applied this code to let the trashed post status to become auto-draft status

    if ( in_array( $post->post_type, $allowed_post_types ) ) {
            $trash_status = 'auto-draft'; // Set trashed posts to auto-draft status
        }
        return $trash_status;
    }
    Way LeongWay Leong
    Participant

    Thank you, love you guys

    Way LeongWay Leong
    Participant

    Hi Peter,

    Thank you, I got it working by creating a field Group and apply the ID into the builder (https://prnt.sc/ZOCjigIf8_U9)

    The delete icon do displayed
    (https://prnt.sc/U0TsxWjpaVYG)

    What if I don't have any custom field to add for the frontend submission, only need 'title & content', how can I still show the 'delete' icon? Or it is necessary to set up a field group even though there is no custom fields in the field group?

    Way LeongWay Leong
    Participant

    The frontend form attribute is using the latest UI build by your team for Bricks Builder

    https://prnt.sc/oSWA03K-ky2n

    The post_fields are set fot thumbnail, title, excerpt & content
    https://prnt.sc/zeIbXonUmG-E

    But it still does not show the trash icon

    in reply to: Post types not displaying on WordPress Admin Panel #32193
    Way LeongWay Leong
    Participant

    Thank you!

    in reply to: Dashboard not working #31332
    Way LeongWay Leong
    Participant

    I am using the latest beta version of Oxygen Builder (3.9 Beta 1), you need to make sure the frontend form shortcode, for my case

    [mb_frontend_form id='details-of-the-company' post_fields='title,content' edit_page='company' allow_delete="true" edit="true" ajax="true"]

    are inserted in the Guternberg editor. Although it does display the dashboard on frontend. But I couldn't see any post details on the dashboard.

    in reply to: Dashboard not working #31326
    Way LeongWay Leong
    Participant

    I'm using Oxygen Builder too to display my dashboard.

    The Dashboard will be displayed if the shortcode is inserted in the Guternberg editor to fix the issue not displaying.

    However, with the dashboard being able to display on the frontend. Another issue arise, where the dashboard did not show any posts that is created by the admin nor users. The Oxygen Builder displays an uncaught error. Kindly refer to the screenshot below

    https://ibb.co/MMnQMkV

    Do we have to wait for Oxygen Builder Development Team to fix the issue or is there any other workaround that can be done? Thanks

    in reply to: Fields don't show in admin column #30642
    Way LeongWay Leong
    Participant

    It happened to me too, I am using Oxygen Builder 3.9 Alpha 1, a custom field group was created where it was grouped with other subcategories of text area, by ticking the admin column checkboxes the data does show up however it appear as "array"

Viewing 10 posts - 16 through 25 (of 25 total)