loadTextdomain( self::DOMAIN, 'languages' ); $this->database = new Database(); $this->query_manipulation = new QueryManipulation( $this ); $this->assets = new Assets($this); $this->rest = new REST($this); $this->ajax = new Ajax(); $this->postsTable = new PostsTable($this); $this->meta_box = new MetaBox( $this ); $this->gutenberg = new Gutenberg($this); $this->user = new User( $this ); $this->render = new Render( $this ); $this->migrate = new Migrate( $this ); $this->update = new Update( $this ); } /** * get the additions authors user ids * * @param null|int $post_id * * @return array */ public function get_ids( $post_id = null ) { return $this->database->get_author_ids($post_id); } /** * Add an unguessable string to end * * @return string */ public function generateUnguessableString() { return bin2hex( openssl_random_pseudo_bytes( 20 ) ); } /** * generate a strong password * @return string */ public function generatePassword() { return wp_generate_password( 20, true ); } /** * on plugin activation */ function onSiteActivation(){ $this->database->install(); } /** * @deprecated use instance() instead * @return Plugin|mixed */ public static function get_instance(){ return static::instance(); } } /** * init plugin and make it accessible */ Plugin::instance(); require_once dirname( __FILE__ ) . "/public-functions.php"; require_once dirname( __FILE__ ) . "/deprecated.php";