builder.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are taking the post id from the URL. The page only can access admin. So nonce verification is not required. |
| 4 | $id = ( isset( $_GET['post'] ) ? intval( wp_unslash( $_GET['post'] ) ) : 0 ); |
| 5 | ?> |
| 6 | <script> |
| 7 | var ekitWidgetBuilder = { |
| 8 | api: '<?php echo esc_url( get_rest_url() . 'elementskit/v1/widget-builder/' ); ?>', |
| 9 | pull_id: <?php echo intval( $id ); ?>, |
| 10 | nonce: '<?php echo esc_js( wp_create_nonce( 'wp_rest' ) ); ?>', |
| 11 | live_url: '<?php echo esc_url( str_replace( array( '&', 'action=edit' ), array( '&', 'action=elementor' ), get_edit_post_link( $id ) ) ); ?>', |
| 12 | pro: <?php echo \ElementsKit_Lite::package_type() == 'pro' ? 'true' : 'false'; ?>, |
| 13 | assets: { |
| 14 | 'wysiwyg': '<?php echo esc_url( $this->url . 'assets/img/wysiwyg.png' ); ?>', |
| 15 | 'noImagePreview': '<?php echo esc_url( $this->url . 'assets/img/no-image.png' ); ?>', |
| 16 | 'imagePreviewTrans': '<?php echo esc_url( $this->url . 'assets/img/transparent_bg.png' ); ?>' |
| 17 | } |
| 18 | }; |
| 19 | </script> |
| 20 | |
| 21 | |
| 22 | <div id="ekitWidgetBuilderApp"></div> |
| 23 |