Plugin Directory

Changeset 2895153


Ignore:
Timestamp:
04/06/2023 04:18:51 PM (3 years ago)
Author:
addonspress
Message:

1.4.0

Location:
advanced-import
Files:
39 added
4 edited

Legend:

Unmodified
Added
Removed
  • advanced-import/trunk/admin/class-advanced-import-admin.php

    r2822658 r2895153  
    11991199
    12001200        /*Move to Trash default page and post*/
    1201         $sample_page      = get_page_by_title( 'Sample Page', OBJECT, 'page' );
    1202         $hello_world_post = get_page_by_title( 'Hello world!', OBJECT, 'post' );
     1201        $sample_page      = advanced_import_get_post_by_title( 'Sample Page', 'page' );
     1202        $hello_world_post = advanced_import_get_post_by_title( 'Hello world!', 'post' );
    12031203        if ( is_object( $sample_page ) ) {
    12041204            wp_trash_post( $sample_page->ID );
     
    12251225        $this_content = $content[ $content_slug ];
    12261226
    1227         if ( isset( $_POST['proceed'] ) ) {
     1227        if ( isset( $_POST['proceed'] ) || apply_filters( 'advanced_import_force_proceed', false ) ) {
    12281228
    12291229            /*install the content*/
     
    12431243                 * import_menu_and_options
    12441244                 * */
    1245                 if ( $result = call_user_func( $this_content['install_callback'] ) ) {
     1245                if ( call_user_func( $this_content['install_callback'] ) ) {
     1246                     $result = call_user_func( $this_content['install_callback'] );
    12461247
    12471248                    $this->log( esc_html__( 'Finish writing ', 'advanced-import' ) . count( $this->delay_posts, COUNT_RECURSIVE ) . esc_html__( ' delayed posts to transient ', 'advanced-import' ) );
     
    13231324
    13241325        /*Import 10 posts at a time*/
    1325         $limit = 10 + ( isset( $_REQUEST['retry_count'] ) ? absint($_REQUEST['retry_count']) : 0 );
     1326        $limit = 10 + ( isset( $_REQUEST['retry_count'] ) ? absint( $_REQUEST['retry_count'] ) : 0 );
    13261327
    13271328        $limit = apply_filters( 'advanced_import_limit_at_time', $limit );
     
    22812282    }
    22822283
    2283     /*check if string is json*/
     2284    /**
     2285     * Check if string is json.
     2286     *
     2287     * @since 1.0.0
     2288     * @access public
     2289     *
     2290     * @param string $string ceck if valid JSON.
     2291     * @return boolean
     2292     */
    22842293    function isJson( $string ) {
    2285         $test_json = @json_decode( $string, true );
     2294        $test_json = $string;
     2295        if ( is_string($string) ) {
     2296            $test_json = json_decode( $string, true );
     2297        }       
    22862298        if ( is_array( $test_json ) ) {
    22872299            return true;
     
    24232435        $message .= '</div>';
    24242436
    2425         apply_filters( 'advanced_import_complete_message', $message );
     2437        $message = apply_filters( 'advanced_import_complete_message', $message );
    24262438
    24272439        do_action( 'advanced_import_before_complete_screen' );
  • advanced-import/trunk/advanced-import.php

    r2822658 r2895153  
    1515 * Plugin URI:        https://addonspress.com/item/advanced-import
    1616 * Description:       Easily import demo data starter site packages or Migrate your site data
    17  * Version:           1.3.9
     17 * Version:           1.4.0
    1818 * Author:            AddonsPress
    1919 * Author URI:        https://addonspress.com/
     
    2525
    2626/*Define Constants for this plugin*/
    27 define( 'ADVANCED_IMPORT_VERSION', '1.3.9' );
     27define( 'ADVANCED_IMPORT_VERSION', '1.4.0' );
    2828define( 'ADVANCED_IMPORT_PLUGIN_NAME', 'advanced-import' );
    2929define( 'ADVANCED_IMPORT_PATH', plugin_dir_path( __FILE__ ) );
  • advanced-import/trunk/includes/functions-advanced-import.php

    r2732013 r2895153  
    7070    return $bytes;
    7171}
     72
     73function advanced_import_get_post_by_title( $title, $post_type = 'page' ) {
     74    $args  = array(
     75        'post_type'      => $post_type,
     76        'post_status'    => 'publish',
     77        'posts_per_page' => 1,
     78        'title'          => $title,
     79    );
     80    $query = new WP_Query( $args );
     81    if ( $query->have_posts() ) {
     82        $query->the_post();
     83        $post = get_post();
     84        wp_reset_postdata();
     85        return $post;
     86    }
     87    return false;
     88}
  • advanced-import/trunk/readme.txt

    r2822658 r2895153  
    55Tags: import, advanced import, demo import, theme import, widget import, customizer import
    66Requires at least: 5.0
    7 Tested up to: 6.1
     7Tested up to: 6.2
    88Requires PHP: 5.6.20
    9 Stable tag: 1.3.9
     9Stable tag: 1.4.0
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    225225== Changelog ==
    226226
     227= 1.4.0 - 2023-04-06 =
     228* Added: New hook `advanced_import_force_proceed`
     229* Updated : Tested up WordPress 6.2
     230* Fixed : [isJson](https://wordpress.org/support/topic/function-isjson-string-causes-fatal-error/)
     231
    227232= 1.3.9 - 2022-11-23 =
    228233* Added : Missing check_admin_referer in one place
Note: See TracChangeset for help on using the changeset viewer.