/home/altere25/infinet.finance/wp-content/plugins/weforms/includes
NameSizeModeActions
admin/-0755rm
api/-0755rm
compat/-0755rm
email/-0755rm
fields/-0755rm
importer/-0755rm
integrations/-0755rm
library/-0755rm
templates/-0755rm
class-ajax-upload.php73760644editdlrm
class-ajax.php456710644editdlrm
class-dokan-integration.php49070644editdlrm
class-emailer.php17150644editdlrm
class-field-manager.php99590644editdlrm
class-form-entry-manager.php23440644editdlrm
class-form-entry.php179170644editdlrm
class-form-manager.php62300644editdlrm
class-form-preview.php49130644editdlrm
class-form-widget.php33000644editdlrm
class-form.php209890644editdlrm
class-frontend-form.php68060644editdlrm
class-importer-manager.php12270644editdlrm
class-installer.php38540644editdlrm
class-integration-manager.php16070644editdlrm
class-notification.php236320644editdlrm
class-scripts-styles.php175250644editdlrm
class-template-manager.php70440644editdlrm
class-upgrades.php13690644editdlrm
class-weforms-api.php18820644editdlrm
country-list.php180460644editdlrm
functions.php381120644editdlrm
Edit: /home/altere25/infinet.finance/wp-content/plugins/weforms/includes/class-form-preview.php (4913B)
form_id = intval( end( $hash ) ); $form = weforms()->form->get( $this->form_id ); if ( !$form ) { return; } $form_settings = $form->get_settings(); if ( !isset( $form_settings['sharing_on'] ) || $form_settings['sharing_on'] !== 'on' ) { return; } if ( !isset( $form_settings['sharing_hash'] ) || $form_settings['sharing_hash'] !== $_hash ) { return; } $this->is_preview = false; } else { $this->form_id = isset( $_GET['form_id'] ) ? intval( $_GET['form_id'] ) : 0; } add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); add_filter( 'the_title', array( $this, 'the_title' ) ); add_filter( 'the_content', array( $this, 'the_content' ) ); add_filter( 'get_the_excerpt', array( $this, 'the_content' ) ); add_filter( 'home_template_hierarchy', array( $this, 'use_page_template_hierarchy' ) ); add_filter( 'frontpage_template_hierarchy', array( $this, 'use_page_template_hierarchy' ) ); add_filter( 'post_thumbnail_html', '__return_empty_string' ); } /** * Set the page title * * @param string $title * * @return string */ public function the_title( $title ) { if ( !in_the_loop() ) { return $title; } $form = weform_get_form( $this->form_id ); if ( !$form ) { return $title; } $preview = $this->is_preview ? 'Preview' : ''; return $form->get_name() . ' ' . $preview; } /** * Set the content of the page * * @param string $content * * @return string */ public function the_content( $content ) { if ( $this->is_preview ) { if ( !is_user_logged_in() ) { return __( 'You must be logged in to preview this form.', 'weforms' ); } $viewing_capability = apply_filters( 'weforms_preview_form_cap', 'edit_posts' ); // at least has to be contributor if ( !current_user_can( $viewing_capability ) ) { return __( 'Sorry, you are not eligible to preview this form.', 'weforms' ); } } return do_shortcode( sprintf( '[weforms id="%d"]', $this->form_id ) ); } /** * Set the posts to one * * @param WP_Query $query * * @return void */ public function pre_get_posts( $query ) { if ( $query->is_main_query() ) { $query->set( 'posts_per_page', 1 ); } } /** * Use page template types. * * Instead of manually locating one page template with the highest priority, * we are going to use the template hierarchy hooks to render the highest priority template. * This resolves issues with Block theme's templating. * * @since 1.6.12 * @param array $templates The list of templates in descending order of priority from WordPress. * * @return array */ public function use_page_template_hierarchy( $templates ) { return array( 'page.php', 'single.php', 'index.php' ); } /** * Limit the page templates to singular pages only * * @deprecated 1.6.11 * @return string */ public function template_include( ) { _deprecated_function( __METHOD__, 'WeForms 1.6.11' ); return locate_template( array( 'page.php', 'single.php', 'index.php' ) ); } }