Custom Fields
Re-Envisioned
Support MB Frontend Submission List of post to edit in frontend Reply To: List of post to edit in frontend

#13914

Hello,

Finally I create a list-page with a table in html with a list of one of my custom post type.
In each post row I put in one column the link to edit the post.

I put the shortcode in 3 places:

–> 1 Place:
I create a page named crear-articulo (to create) with the shortcode:
[mb_frontend_form post_type="articulo" edit="true" id="organizacion" post_fields="title,content" label_title="Título" submit_button="Dar de alta el artículo"]

–> 2 Place:
I create a page named modificar-articulo (to update) with the shortcode:
[mb_frontend_form post_type="articulo" edit="true" id="organizacion" post_fields="title,content" label_title="Título" submit_button="Dar de alta el artículo" post_id="current"]

–> 3 Place:
I add a filter to add after the $content the shortcode to can update the actual post:
[mb_frontend_form post_type="articulo" edit="true" id="organizacion" post_fields="title,content" label_title="Título" submit_button="Dar de alta el artículo" post_id="current"]

To edit the post, I have some options?

–> 1 Option: Put in each row the link to the same page to create de post:

`$link = home_url( '/crear-articulo/' );
$link = add_query_arg( 'rwmb_frontend_field_post_id', $post->ID, $link );        
return '<a href="'.$link.'">Editar</a>';`

–> 2 Option: Put in each row the link to the update post page:

`$link = home_url( '/modificar-articulo/' );
$link = add_query_arg( 'rwmb_frontend_field_post_id', $post->ID, $link );        
return '<a href="'.$link.'">Editar</a>';`

Questions:
– What is the best option? Am I doing well so far?
– With the option 1, I only have to create one page to create and update posts. But I have a issue with the shortcodes. In the content field of the create page, the shortcodes are not shown, they are already half solved:
Ex: It appear this the text but not the shortcode…
Título del spoiler
Contenido oculto
Título del spoiler
Contenido oculto
Título del spoiler
Contenido oculto

But in the update page, the shortcodes are displayed well, as in the backoffice editor:

[su_accordion class=""]
[su_spoiler title="Título del spoiler" open="no" style="default" icon="plus" anchor="" class=""]Contenido oculto[/su_spoiler] 
[su_spoiler title="Título del spoiler" open="no" style="default" icon="plus" anchor="" class=""]Contenido oculto[/su_spoiler] 
[su_spoiler title="Título del spoiler" open="no" style="default" icon="plus" anchor="" class=""]Contenido oculto[/su_spoiler] 
[/su_accordion]

The same issue have in the shortcode situated in the 3 place.

Many Thanks.