Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
automatically-paginate-posts.php 23.34 KiB
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
 * Automatically inserts the &lt;!--nextpage--&gt; Quicktag into WordPress posts, pages, or custom post type content.
 *
 * Plugin Name: Automatically Paginate Posts
 * Plugin URI: http://www.oomphinc.com/plugins-modules/automatically-paginate-posts/
 * Description: Automatically inserts the &lt;!--nextpage--&gt; Quicktag into WordPress posts, pages, or custom post type content.
 * Version: 0.3
 * Author: Erick Hitter & Oomph, Inc.
 * Author URI: http://www.oomphinc.com/
 * Text Domain: autopaging
 * Domain Path: /languages/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @package automatically-paginate-posts
 */

require_once dirname( __FILE__ ) . '/inc/class-block-editor.php';

/**
 * Class Automatically_Paginate_Posts.
 */
class Automatically_Paginate_Posts {
	/**
	 * Supported post types.
	 *
	 * @var array
	 */
	private $post_types;

	/**
	 * Default supported post types.
	 *
	 * @var array
	 */
	private $post_types_default = array( 'post' );

	/**
	 * Desired number of pages to split to.
	 *
	 * @var int
	 */
	private $num_pages;

	/**
	 * Method for splitting content, either words or desired number of pages.
	 *
	 * @var string
	 */
	private $paging_type_default = 'pages';

	/**
	 * Default number of pages to split to.
	 *
	 * @var int
	 */
	private $num_pages_default = 2;