Remove distraction free mode from teeny editor

So after researching some wordpress filters i found the teeny_mce_buttons and removed the distraction free button with this function. function remove_teeny_mce_btns($buttons) { unset($buttons[13]); return $buttons; } add_filter(‘teeny_mce_buttons’, ‘remove_teeny_mce_btns’); Here is the link with the solution: https://www.gavick.com/blog/wordpress-tinymce-custom-buttons

register_activation_hook not creating table

You create auto column sno int(10) NOT NULL AUTO_INCREMENT, and forget to define it as key, add PRIMARY KEY (sno) to your sql. $sql = “CREATE TABLE $table_name ( sno int(10) NOT NULL AUTO_INCREMENT, postid int(50) NOT NULL, subpostid varchar(5) NOT NULL, votingcount varchar(50) NOT NULL, postclicktime timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (sno) … Read more

Custom permalink structure for posts in certain categories

here is a solution to search through all categories, not only the first one. add_filter(‘post_link’, ‘custom_permalink’, 10, 2); function custom_permalink( $permalink, $post ) { // Get the categories for the post $categories = get_the_terms($post->ID, ‘category’); if (!empty($categories)) { foreach ($categories as $category) { if ($category->cat_name == “ICO”) { $cat_name = strtolower($category->cat_name); $permalink = trailingslashit( home_url(“https://wordpress.stackexchange.com/” … Read more