Get local cloud templates page content in programmatic way

Posted in: Newspaper
Post count: 28

Hi, how can i get source code (or maybe this is content in this case) of a local cloud template, which are located at wp-admin/admin.php?page=tdb_cloud_templates from php?
Thank toy

Post count: 21065

Hello!

You can not find in files. Access Dashboard -> Cloud templates and there you can see and edit your templates.

Thank you!

Post count: 28

thanks for the quick answer, but the question was slightly different) I asked how to do it programmatically from the code (php)

Post count: 21065

Hello!

The cloud templates do not have PHP files because they are stored in the database as custom post types.

Thank you!

Post count: 28

Hello!
Great, and my question is how to get the content of these pages using php commands, or even better through rest api, perhaps there are code examples somewhere on how to get or change these templates using php
Thank you

  • This reply was modified 3 years by usc-shift.
  • This reply was modified 3 years by usc-shift.
Post count: 28

ok, I figured it out and added the option to show_in_rest = true, but now the problem is that before json response, the html login form is displayed, how can I change this behavior
my code

add_action( 'init', 'my_custom_post_type_rest_support', 25 );
function my_custom_post_type_rest_support() {
    global $wp_post_types;
    //be sure to set this to the name of your post type!
    $post_type_name = 'tdb_templates';
    if( isset( $wp_post_types[ $post_type_name ] ) ) {
		$wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
        $wp_post_types[$post_type_name]->show_in_rest = true;
        // Optionally customize the rest_base or controller class
        $wp_post_types[$post_type_name]->rest_base = $post_type_name;

    }
}

an answer

<!-- LOGIN MODAL -->

                <div id="login-form" class="white-popup-block mfp-hide mfp-with-anim td-login-modal-wrap">
                    <div class="td-login-wrap">
                        <a href="#"><i class="td-icon-modal-back"></i></a>
                        <div id="td-login-div" class="td-login-form-div td-display-block">
                            <div class="td-login-panel-title">Anmelden</div>
                            <div class="td-login-panel-descr">Herzlich willkommen! Melden Sie sich an</div>
                            <div class="td_display_err"></div>
                            <form id="loginForm" action="#" method="post">...... 

and after login form the normal json answer is displayed

even if I send the request while logged in with jwt token

how can i get rid of the login form in the response

Thank you

  • This reply was modified 3 years by usc-shift.
Post count: 21065

Hello!

This will require custom work which is not covered by the support team.
For customization and other services you can contact our custom work team here: https://tagdiv.com/premium-customization-services/

Thank you so much for understanding!

Post count: 28

No custom development is required, I just asked how I can go back to the default api answer and remove what the newspaper template brings (login form).

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.