classHooks{/** * @varPlugin * */protectedPlugin $plugin;publicfunction__construct(Plugin $plugin) {$this->plugin = $plugin; }publicfunctionaddHooks(){add_action('admin_menu', [$this->plugin->getAdmin(), 'init']);add_action('rest_api_init', [$this->plugin->getApi(), 'super_long_method_name_that_just_goes_on_and_on']); }//long long long //long long long //long long long //long long long //long long longpublicfunctionremoveHooks(){remove_action('admin_menu', [$this->plugin->getAdmin(), 'init']);remove_action('rest_api_init', [$this->plugin->getApi(), 'super_long_method_name_that_just_goes_on_and_on']); }}
class Hooks{
/**
* @var Plugin
*
*/
protected Plugin $plugin;
public function __construct(Plugin $plugin)
{
$this->plugin = $plugin;
}
public function addHooks(){
add_action('admin_menu', [$this->plugin->getAdmin(), 'init']);
add_action('rest_api_init', [$this->plugin->getApi(), 'super_long_method_name_that_just_goes_on_and_on']);
}
//long long long //long long long //long long long //long long long //long long long
public function removeHooks(){
remove_action('admin_menu', [$this->plugin->getAdmin(), 'init']);
remove_action('rest_api_init', [$this->plugin->getApi(), 'super_long_method_name_that_just_goes_on_and_on']);
}
}
$my_post = array(
'post_title' => wp_strip_all_tags( $_POST['post_title'] ),
'post_content' => $_POST['post_content'],
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array( 8,39 )
);
$x = 'very long line 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424';
// Insert the post into the database
wp_insert_post( $my_post );
$my_post =array('post_title'=>wp_strip_all_tags( $_POST['post_title'] ),'post_content'=> $_POST['post_content'],'post_status'=>'publish','post_author'=>1,'post_category'=>array( 8,39 ));$x ='very long line 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424 42424';// Insert the post into the databasewp_insert_post( $my_post );