get_default_content example

<?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p> <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p> <div class="privacy-settings-accordion"> <h4 class="privacy-settings-accordion-heading"> <button aria-expanded="false" class="privacy-settings-accordion-trigger" aria-controls="privacy-settings-accordion-block-privacy-policy-guide" type="button"> <span class="title"><?php _e( 'Privacy Policy Guide' ); ?></span> <span class="icon"></span> </button> </h4> <div id="privacy-settings-accordion-block-privacy-policy-guide" class="privacy-settings-accordion-panel" hidden="hidden"> <?php             $content = WP_Privacy_Policy_Content::get_default_content( true, false );
            echo $content;
            ?> </div> </div> <hr class="hr-separator"> <h3 class="section-title"><?php _e( 'Policies' ); ?></h3> <div class="privacy-settings-accordion wp-privacy-policy-guide"> <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?> </div> </div> <?php


        // Privacy Policy page.         if ( is_multisite() ) {
            // Disable by default unless the suggested content is provided.             $privacy_policy_content = get_site_option( 'default_privacy_policy_content' );
        } else {
            if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
                require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';
            }

            $privacy_policy_content = WP_Privacy_Policy_Content::get_default_content();
        }

        if ( ! empty( $privacy_policy_content ) ) {
            $privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';

            $wpdb->insert(
                $wpdb->posts,
                array(
                    'post_author'           => $user_id,
                    'post_date'             => $now,
                    'post_date_gmt'         => $now_gmt,
                    
'5.7.0',
            'wp_add_privacy_policy_content()'
        );
    }

    /** * Adds the suggested privacy policy text to the policy postbox. * * @since 4.9.6 */
    public static function add_suggested_content() {
        $content = self::get_default_content( false, false );
        wp_add_privacy_policy_content( __( 'WordPress' )$content );
    }
}

            }
        }

        add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', $privacy_page_updated_message, 'success' );
    } elseif ( 'create-privacy-page' === $action ) {

        if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
            require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';
        }

        $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
        $privacy_policy_page_id      = wp_insert_post(
            array(
                'post_title'   => __( 'Privacy Policy' ),
                'post_status'  => 'draft',
                'post_type'    => 'page',
                'post_content' => $privacy_policy_page_content,
            ),
            true
        );

        if ( is_wp_error( $privacy_policy_page_id ) ) {
            
Home | Imprint | This part of the site doesn't use cookies.