Changeset 3446880
- Timestamp:
- 01/26/2026 07:19:17 AM (2 months ago)
- Location:
- blog-in-blog/trunk
- Files:
-
- 4 added
- 5 edited
-
. (modified) (1 prop)
-
blocks (added)
-
blocks/blog-in-blog-block.css (added)
-
blocks/blog-in-blog-block.js (added)
-
blocks/blog-in-blog-block.php (added)
-
blog-in-blog.php (modified) (9 diffs)
-
blog-in-blog.pot (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
blog-in-blog/trunk
- Property svn:ignore
-
old new 12 12 .dockerignore 13 13 .vscode 14 .claude
-
- Property svn:ignore
-
blog-in-blog/trunk/blog-in-blog.php
r3446690 r3446880 5 5 Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/ 6 6 Description: Create a blog within a blog using a category, post_type or tag. This plugin basically shows selected posts on a page using shortcodes. 7 Version: 1.1.17 Version: 2.0.0 8 8 Author: Tim Hodson 9 9 Author URI: http://timhodson.com … … 33 33 34 34 if (!defined('BIB_VERSION')) 35 define('BIB_VERSION', ' 1.1.1');35 define('BIB_VERSION', '2.0.0'); 36 36 37 37 if (!defined('BIB_WP_UPLOADS_DIR')) { … … 42 42 include_once( WP_PLUGIN_DIR . "/blog-in-blog/options.php" ); 43 43 44 // Include Gutenberg block 45 include_once( WP_PLUGIN_DIR . "/blog-in-blog/blocks/blog-in-blog-block.php" ); 46 44 47 $plugin_dir = basename(dirname(__FILE__)); 48 49 /** 50 * Plugin activation hook. 51 * Sets up default options when the plugin is first activated. 52 */ 53 function blog_in_blog_activate() { 54 // Initialize default options 55 bib_init_opts(); 56 // Store the plugin version 57 update_option('bib_version', BIB_VERSION); 58 } 59 register_activation_hook(__FILE__, 'blog_in_blog_activate'); 60 61 /** 62 * Plugin deactivation hook. 63 * Performs cleanup when the plugin is deactivated. 64 * Note: Options are preserved - they are only deleted on uninstall. 65 */ 66 function blog_in_blog_deactivate() { 67 // Nothing to do on deactivation - options preserved for reactivation 68 // Uninstall.php handles full cleanup when plugin is deleted 69 } 70 register_deactivation_hook(__FILE__, 'blog_in_blog_deactivate'); 45 71 46 72 global $blog_in_blog_opts; … … 53 79 bib_write_debug(__FUNCTION__, print_r($atts, TRUE)); 54 80 55 if(! is_page()){ 81 // Allow rendering on pages, in REST API (for Gutenberg), and in admin (for previews) 82 $is_rest_request = defined('REST_REQUEST') && REST_REQUEST; 83 $is_admin_request = is_admin(); 84 if (!is_page() && !$is_rest_request && !$is_admin_request) { 56 85 return wpautop(wptexturize("<strong>ERROR:</strong> Blog-in-Blog shortcodes can only be used in pages, not posts.")); 57 86 } … … 107 136 } 108 137 138 // Initialize template comment (will be prepended to output, but not during REST requests) 139 $template_comment = ''; 140 109 141 // set the template if set in shortcode, look in uploads, then plugin dir, then use default. 110 142 if ($template != '') { … … 121 153 } 122 154 // currently no default applied here... 123 } 155 } 156 124 157 if (file_exists(BIB_WP_UPLOADS_DIR . "/" . $template)) { 125 158 $blog_in_blog_opts['bib_post_template'] = BIB_WP_UPLOADS_DIR . "/" . $template; 126 echo"<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ;159 $template_comment = "<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ; 127 160 bib_write_debug(__FUNCTION__, "using template ".$blog_in_blog_opts['bib_post_template']); 128 161 129 162 } else if (file_exists(WP_CONTENT_DIR . '/uploads/' . $template)) { 130 163 $blog_in_blog_opts['bib_post_template'] = WP_CONTENT_DIR . '/uploads/' . $template; 131 echo"<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ;164 $template_comment = "<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ; 132 165 bib_write_debug(__FUNCTION__, "using template ".$blog_in_blog_opts['bib_post_template']); 133 166 134 167 } else if (file_exists(WP_PLUGIN_DIR . "/blog-in-blog/" . $template)) { 135 168 $blog_in_blog_opts['bib_post_template'] = WP_PLUGIN_DIR . "/blog-in-blog/" . $template; 136 echo"<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ;169 $template_comment = "<!-- BIB: using template: " . esc_html($blog_in_blog_opts['bib_post_template']) . " -->" ; 137 170 bib_write_debug(__FUNCTION__, "using template ".$blog_in_blog_opts['bib_post_template']); 138 171 139 172 }else{ 140 173 $blog_in_blog_opts['bib_post_template'] = ''; // this will force using of bib_html option 141 //echo "Cannot find template file <b>$template</b> in either <code>".BIB_WP_UPLOADS_DIR."/</code> or <code>".WP_PLUGIN_DIR."/blog-in-blog/</code>" ;142 174 bib_write_debug(__FUNCTION__, "template not found ".$blog_in_blog_opts['bib_post_template']); 143 175 } 144 176 } else { 145 177 $blog_in_blog_opts['bib_post_template'] = ''; // this will force using bib_html from database. 146 echo"<!-- BIB: using default template from database -->" ;178 $template_comment = "<!-- BIB: using default template from database -->" ; 147 179 bib_write_debug(__FUNCTION__, "defaulting to database template."); 148 180 } … … 256 288 257 289 // return the posts data. 290 // Include template comment only for non-REST requests (front-end display) 291 if (!$is_rest_request && !empty($template_comment)) { 292 $out = $template_comment . $out; 293 } 258 294 return bib_do_shortcode($out); 259 295 } … … 623 659 global $post ; 624 660 global $blog_in_blog_opts ; 661 662 // Only apply our custom excerpt_more when Blog in Blog is rendering 663 if (!isset($blog_in_blog_opts['current_post_id']) || empty($blog_in_blog_opts['current_post_id'])) { 664 return $more; 665 } 666 625 667 bib_write_debug(__FUNCTION__, "Using excerpt more filter"); 626 668 … … 670 712 // This especially problematic when bib is included in a page which is then included in another page! 671 713 // however big problem is identifying if this is the home page. if it is then we need to do something clever. 672 bib_write_debug( __FUNCTION__,"Host Page ID: ".$blog_in_blog_opts['host_page']); 714 $host_page = isset($blog_in_blog_opts['host_page']) ? $blog_in_blog_opts['host_page'] : 'unknown'; 715 bib_write_debug( __FUNCTION__,"Host Page ID: ".$host_page); 673 716 674 717 //if ($wp_query->is_home()){ -
blog-in-blog/trunk/blog-in-blog.pot
r347739 r3446880 1 # Copyright (C) 20 10 Blog in Blog2 # This file is distributed under the same license as the Blog in Blog p ackage.1 # Copyright (C) 2026 Tim Hodson 2 # This file is distributed under the same license as the Blog in Blog plugin. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Blog in Blog 1.0.3\n" 6 "Report-Msgid-Bugs-To: http://wordpress.org/tag/blog-in-blog\n" 7 "POT-Creation-Date: 2011-02-19 15:42:22+00:00\n" 5 "Project-Id-Version: Blog in Blog 1.1.1\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/blog-in-blog\n" 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 "Language-Team: LANGUAGE <LL@li.org>\n" 8 9 "MIME-Version: 1.0\n" 9 10 "Content-Type: text/plain; charset=UTF-8\n" 10 11 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Language-Team: LANGUAGE <LL@li.org>\n" 14 15 #: blog-in-blog.php:395 12 "POT-Creation-Date: 2026-01-25T21:58:38+00:00\n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.12.0\n" 15 "X-Domain: blog-in-blog\n" 16 17 #. Plugin Name of the plugin 18 #: blog-in-blog.php 19 msgid "Blog in Blog" 20 msgstr "" 21 22 #. Plugin URI of the plugin 23 #: blog-in-blog.php 24 msgid "http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/" 25 msgstr "" 26 27 #. Description of the plugin 28 #: blog-in-blog.php 29 msgid "Create a blog within a blog using a category, post_type or tag. This plugin basically shows selected posts on a page using shortcodes." 30 msgstr "" 31 32 #. Author of the plugin 33 #: blog-in-blog.php 34 msgid "Tim Hodson" 35 msgstr "" 36 37 #. Author URI of the plugin 38 #: blog-in-blog.php 39 msgid "http://timhodson.com" 40 msgstr "" 41 42 #: blog-in-blog.php:551 16 43 msgid "Comments" 17 44 msgstr "" 18 45 19 #: blog-in-blog.php:396 46 #: blog-in-blog.php:552 47 #, php-format 20 48 msgid "%d Comment" 21 49 msgid_plural "%d Comments" … … 23 51 msgstr[1] "" 24 52 25 #: blog-in-blog.php: 40153 #: blog-in-blog.php:555 26 54 msgid "Respond" 27 55 msgstr "" 28 56 29 #: blog-in-blog.php: 40257 #: blog-in-blog.php:556 30 58 msgid "Leave a response " 31 59 msgstr "" 32 60 33 #: blog-in-blog.php: 40761 #: blog-in-blog.php:559 34 62 msgid "Comments are closed" 35 63 msgstr "" 36 64 37 #: blog-in-blog.php:481 38 msgid "There is no excerpt because this is a protected post." 39 msgstr "" 40 41 #: options.php:30 65 #: options.php:32 42 66 msgid "Page" 43 67 msgstr "" 44 68 45 #: options.php:3 669 #: options.php:39 46 70 msgid "more" 47 71 msgstr "" 48 72 49 #: options.php:1 2573 #: options.php:142 50 74 msgid "Category(ies) to hide from homepage." 51 75 msgstr "" 52 76 53 #: options.php:1 2877 #: options.php:145 54 78 msgid "Hide categories from feed?" 55 79 msgstr "" 56 80 57 #: options.php:1 3981 #: options.php:156 58 82 msgid "Text to show as \"previous page\" link" 59 83 msgstr "" 60 84 61 #: options.php:1 4285 #: options.php:159 62 86 msgid "Text to show as \"next page\" link" 63 87 msgstr "" 64 88 65 #: options.php:145 66 msgid "" 67 "Text to show preceeding page 1. e.g. Post (Post 1, 2, 3) or Page (Page 1, 2, " 68 "3) etc" 69 msgstr "" 70 71 #: options.php:148 89 #: options.php:162 90 msgid "Text to show preceeding page 1. e.g. Post (Post 1, 2, 3) or Page (Page 1, 2, 3) etc" 91 msgstr "" 92 93 #: options.php:165 72 94 msgid "The characters to show between page links, e.g. \",\" or \"|\"" 73 95 msgstr "" 74 96 75 #: options.php:1 5197 #: options.php:168 76 98 msgid "Show dots (elipsis ... ) after n pages" 77 99 msgstr "" 78 100 79 #: options.php:1 54101 #: options.php:171 80 102 msgid "Style for current page e.g. font-weight:bold;" 81 103 msgstr "" 82 104 83 #: options.php:1 57105 #: options.php:174 84 106 msgid "Style for non current page e.g. color:grey;" 85 107 msgstr "" 86 108 87 #: options.php:17988 msgid "The html for the post template."89 msgstr ""90 91 #: options.php:18292 msgid ""93 "Text for the more link if you use the <!--more--> tag in your posts."94 msgstr ""95 96 109 #: options.php:185 110 msgid "The html for the default post template." 111 msgstr "" 112 113 #: options.php:189 114 msgid "User templates" 115 msgstr "" 116 117 #: options.php:192 118 msgid "Text for the more link if you use the <!--more--> tag in your posts." 119 msgstr "" 120 121 #: options.php:195 97 122 msgid "Size of the author avatar image (pixels)" 98 123 msgstr "" 99 124 100 #: options.php:1 89125 #: options.php:199 101 126 msgid "Custom Fields" 102 127 msgstr "" 103 128 104 #: options.php:192105 msgid ""106 "Custom fields that should be formatted as dates in the template tags (uses "107 "default wordpress date format). "108 msgstr ""109 110 129 #: options.php:202 130 msgid "Custom fields that should be formatted as dates in the template tags (uses default wordpress date format). " 131 msgstr "" 132 133 #: options.php:212 134 msgid "Disable use of javascript on the admin page. This will show all settings in one go." 135 msgstr "" 136 137 #: options.php:215 111 138 msgid "Show some ugly debugging info" 112 139 msgstr "" 113 140 114 #: options.php:216 115 msgid "" 116 "Define which categories should be hidden from the home page and optionally " 117 "exclude them from the feeds. Choose more than one category if required. Only " 118 "categories with posts will appear for selection." 119 msgstr "" 120 121 #: options.php:251 141 #: options.php:225 142 msgid "Define which categories should be hidden from the home page and optionally exclude them from the feeds. Choose more than one category if required. Only categories with posts will appear for selection." 143 msgstr "" 144 145 #: options.php:261 122 146 msgid "Show all categories" 123 147 msgstr "" 124 148 125 #: options.php:275 126 msgid "" 127 "The pagination menu is shown by default when there are more posts than will " 128 "fit on a page (as controlled by the 'num' shortcode parameter). These " 129 "settings will allow you to change the pagination menu styling. See the help " 130 "for turning pagination on and off" 131 msgstr "" 132 133 #: options.php:321 134 msgid "" 135 "The template is used to format each post displayed by a Blog-in-Blog " 136 "shortcode. Edit the HTML below to update your current default template (this " 137 "was copied from your existing default template file on upgade to this " 138 "version). If you want to have more than one template in use for different " 139 "instances of the shortcode, you can specify a template file using a " 140 "shortcode paramater. We always look in `wp-content/uploads/` for your " 141 "template file first (your template will be safe under uploads/) before " 142 "looking in `wp-content/plugins/blog-in-blog` (your template will probably be " 143 "lost when the plugin is upgraded). For more template tags see the help tab." 144 msgstr "" 145 146 #: options.php:350 147 msgid "" 148 "It is possible to display your custom fields in your post using template " 149 "tags. The template tag will be the name of your custom field surrounded by a " 150 "percent symbol (%). For example %my_field% . When you use date values in " 151 "your custom fields, they should be entered using the format YYYY-MM-DD if " 152 "you require sorting on a custom field in date order to work as expected. You " 153 "can define which custom fields should be reformatted as a 'pretty' date in " 154 "your locale specific format. " 155 msgstr "" 156 157 #: options.php:386 149 #: options.php:325 150 msgid "The template is used to format each post displayed by a Blog-in-Blog shortcode. Edit the HTML below to update your current default template (this was copied from your existing default template file on upgade to this version). If you want to have more than one template in use for different instances of the shortcode, you can specify a template file using a shortcode paramater. We always look in `wp-content/uploads/` for your template file first (your template will be safe under uploads/) before looking in `wp-content/plugins/blog-in-blog` (your template will probably be lost when the plugin is upgraded). For more template tags see the help tab." 151 msgstr "" 152 153 #: options.php:467 154 msgid "It is possible to display your custom fields in your post using template tags. The template tag will be the name of your custom field surrounded by a percent symbol (%). For example %my_field% . When you use date values in your custom fields, they should be entered using the format YYYY-MM-DD if you require sorting on a custom field in date order to work as expected. You can define which custom fields should be reformatted as a 'pretty' date in your locale specific format. " 155 msgstr "" 156 157 #: options.php:503 158 158 msgid "Select none" 159 159 msgstr "" 160 160 161 #: options.php: 400161 #: options.php:517 162 162 msgid "Some extra settings." 163 163 msgstr "" 164 164 165 #: options.php:537 165 #: options.php:546 166 msgid "You do not have sufficient permissions to access this page." 167 msgstr "" 168 169 #: options.php:697 166 170 msgid "Category" 167 171 msgstr "" 168 172 169 #: options.php: 538173 #: options.php:698 170 174 msgid "Pagination" 171 175 msgstr "" 172 176 173 #: options.php: 539177 #: options.php:699 174 178 msgid "Template" 175 179 msgstr "" 176 180 177 #: options.php: 540178 msgid " Debug"179 msgstr "" 180 181 #: options.php: 541181 #: options.php:700 182 msgid "Misc" 183 msgstr "" 184 185 #: options.php:701 182 186 msgid "Help" 183 187 msgstr "" 184 188 185 #: options.php:552 options.php:560 options.php:568 options.php:577 186 #: options.php:589 187 msgid "Save All Changes" 188 msgstr "" 189 190 #: options.php:594 189 #: options.php:702 190 msgid "Donate" 191 msgstr "" 192 193 #: options.php:756 194 msgid "Support Blog-in-Blog Development" 195 msgstr "" 196 197 #: options.php:758 198 msgid "Hi! I'm Tim, the developer of Blog-in-Blog. I created this plugin and maintain it in my free time, alongside my day job and family life." 199 msgstr "" 200 201 #: options.php:759 202 msgid "If you find this plugin useful for your website, please consider buying me a coffee! Your support helps me dedicate time to:" 203 msgstr "" 204 205 #: options.php:761 206 msgid "Keeping the plugin updated and compatible with the latest WordPress versions" 207 msgstr "" 208 209 #: options.php:762 210 msgid "Fixing bugs and improving performance" 211 msgstr "" 212 213 #: options.php:763 214 msgid "Adding new features based on user feedback" 215 msgstr "" 216 217 #: options.php:764 218 msgid "Providing support to users" 219 msgstr "" 220 221 #: options.php:766 222 msgid "Every donation, no matter how small, is greatly appreciated and motivates me to keep improving this plugin. Thank you! 🙏" 223 msgstr "" 224 225 #: options.php:780 191 226 msgid "See full notes at" 192 227 msgstr "" 193 194 #. Plugin Name of the plugin/theme195 msgid "Blog in Blog"196 msgstr ""197 198 #. Plugin URI of the plugin/theme199 msgid "http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/"200 msgstr ""201 202 #. Description of the plugin/theme203 msgid ""204 "Create a blog within a blog using a category. This plugin basically shows "205 "posts in a category on a page using shortcodes."206 msgstr ""207 208 #. Author of the plugin/theme209 msgid "Tim Hodson"210 msgstr ""211 212 #. Author URI of the plugin/theme213 msgid "http://timhodson.com"214 msgstr "" -
blog-in-blog/trunk/readme.txt
r514003 r3446880 2 2 Contributors: timhodson 3 3 Donate link: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/ 4 Tags: categories, blog, hide, cms 5 Requires at least: 3.0 6 Tested up to: 3.3.1 7 Stable tag: 1.1.1 4 Tags: categories, blog, hide, cms, shortcode, posts, gutenberg, block 5 Requires at least: 5.0 6 Tested up to: 6.7 7 Stable tag: 2.0.0 8 Requires PHP: 8.0 8 9 9 10 This plugin shows posts from a category on any page you like using shortcodes. Create multiple blogs within a blog using a category. Hode posts in a specific category from your homepage. … … 193 194 == Changelog == 194 195 195 = 1.1.1 = 196 = 2.0.0 = 197 198 Major update for modern WordPress and PHP compatibility. 199 200 * Added: Gutenberg block editor support - use Blog in Blog visually in the block editor 201 * Added: PHP 8.0, 8.1, 8.2, 8.3 compatibility 202 * Added: WordPress 6.x compatibility 203 * Added: Activation and deactivation hooks for proper plugin lifecycle 204 * Fixed: Replaced deprecated `split()` with `explode()` 205 * Fixed: Replaced deprecated `__ngettext()` with `_n()` 206 * Fixed: Replaced deprecated `wp_get_single_post()` with `get_post()` 207 * Fixed: Replaced deprecated `utf8_encode()` with `mb_convert_encoding()` 208 * Fixed: Replaced old PHP Markdown library with modern Parsedown 209 * Security: Added `$wpdb->prepare()` to all dynamic SQL queries 210 * Security: Added proper input sanitization to all shortcode attributes 211 * Security: Added sanitization callbacks to all settings 212 * Security: Added output escaping throughout the plugin 213 * Security: Added capability checks for admin pages 214 * Removed: Legacy pre-WordPress 2.6 compatibility code 215 * Removed: Deprecated `extract()` usage 216 * Updated: Translation POT file 217 218 = 1.1.1 = 196 219 197 220 * Fixed: Read more links for post excerpts are now fixed. -
blog-in-blog/trunk/uninstall.php
r347736 r3446880 22 22 23 23 if(defined('ABSPATH') && defined('WP_UNINSTALL_PLUGIN')){ 24 // Pagination options 24 25 delete_option('bib_show_dots_after'); 25 26 delete_option('bib_text_delim'); 26 delete_option('bib_text_page' ); 27 delete_option('bib_text_previous' ); 28 delete_option('bib_text_next' ); 29 delete_option('bib_style_selected' ); 30 delete_option('bib_style_not_selected' ); 27 delete_option('bib_text_page'); 28 delete_option('bib_text_previous'); 29 delete_option('bib_text_next'); 30 delete_option('bib_style_selected'); 31 delete_option('bib_style_not_selected'); 32 33 // Template options 31 34 delete_option('bib_post_template'); 35 delete_option('bib_html'); 36 delete_option('bib_templates'); 32 37 delete_option('bib_more_link_text'); 33 38 delete_option('bib_avatar_size'); 39 40 // Category options 34 41 delete_option('bib_hide_category_from_rss'); 35 42 delete_option('bib_hide_category'); 36 delete_option('bib_hide_category[]'); 43 44 // Meta/debug options 37 45 delete_option('bib_meta_keys'); 38 46 delete_option('bib_debug'); 39 delete_option('bib_html'); 40 delete_option('bib_single'); 47 delete_option('bib_no_collapse'); 48 delete_option('bib_last_tab'); 49 50 // Version tracking 51 delete_option('bib_version'); 41 52 } 42 53
Note: See TracChangeset
for help on using the changeset viewer.