Loop Injection
Developed by azurecurve
Plugin Description
Allows content to be injected before, within and after the loop.
Allows content to be injected before, within and after the loop. All content is configurable via an admin settings page.
Each of the three content locations can be activated individually and the location within the loop is configurable; perfect for injecting adverts. Shortcodes are supported in Loop Injection.
This plugin is multisite compatible; each site has its own independent settings and needs its content configured separately in the admin dashboard.
- Download the latest release of the plugin from GitHub.
- Upload the entire zip file using the Plugins upload function in your ClassicPress admin panel.
- Activate the plugin.
- Configure relevant settings via the configuration page in the admin control panel (azurecurve menu).
Yes, the .pot file is in the plugin’s assets/languages folder; if you do translate this plugin, please send the .po and .mo files to [email protected] for inclusion in the next version (full credit will be given).
This plugin is developed for ClassicPress, but will likely work on WordPress.
- Rebuilt to match the current azurecurve plugin architecture (namespaced code, settings/menu split across includes files, tabbed admin UI matching Shortcodes in Comments).
- Fixed a bug where the “Position Within Loop” setting was off by one post: WP_Query’s internal post counter is zero-indexed, so a setting of “5” previously injected the advert after the 6th post rather than the 5th. It now injects after the Nth post, matching the field’s description.
- Fixed a bug where the within-loop advert was not reliably scoped to the main query, unlike the before/after-loop adverts: the hook it used fires for every loop on a page (including widgets and other secondary queries), and the plugin’s only safeguard against leaking into those was an unreliable comparison against the global $wp_query object. It now checks is_main_query() directly, the same way the before/after-loop adverts already did.
- Fixed an undefined-function fatal-error risk: a network-admin save action was hooked to a function, azrcrv_li_save_network_options(), that was never actually defined anywhere in the plugin.
- Removed the multisite network-wide settings feature (Network Admin > Settings > Loop Injection and the per-site “Use Network Settings” option) – it was never really supported by ClassicPress and, on top of that, was found to be non-functional in the pre-2.0.0 plugin (the “Use Network Settings” checkbox was read from one option key but saved to a different one, and the Network Admin page had no form of its own to submit to the undefined save handler in the first place). Each site now always uses its own Settings tab.
- Fixed several admin-facing strings using the wrong translation text domain (copy-pasted from another azurecurve plugin), which meant they silently failed to translate.
- Fixed malformed markup (stray closing
</em>tags with no matching opening tag) on the Settings page. - Removed a leftover, empty (0-byte) jQuery asset that was bundled but never enqueued or used.
- Removed an empty, unused front-end stylesheet that was unconditionally enqueued on every front-end page load.
- Fixed an inefficient
plugin_action_linkshook so it no longer runs for every plugin on the Plugins list page. - Replaced the hard-coded plugin menu list with a standard, auto-generated Other Plugins tab.
- Added an Instructions tab, including an explicit explanation of how “Position Within Loop” is counted.
- Added a proper
uninstall.phprestyled for consistency with the rest of the azurecurve plugin family (same cleanup behaviour as before). - BREAKING: minimum PHP requirement raised to 8.2.
- BREAKING: text domain renamed from
loop-injectiontoazrcrv-li; existing translation (.po/.mo) files must be re-supplied under the new domain. - BREAKING: translation Domain Path moved from
/languagesto/assets/languages. - BREAKING: if you were relying on “Position Within Loop” injecting after N+1 posts (the pre-2.0.0 buggy behaviour), or on the within-loop advert appearing inside a secondary/custom loop, review your configuration after upgrading – both of those behaviours have changed as part of the bug fixes above.
- Update readme.md and remove readme.txt (not required for ClassicPress).
- Update azurecurve menu.
- Update plugin header for compatibility with ClasssicPress v2.
- Update plugin header and readme for compatibility with ClassicPress Directory v2.
- Update Update Manager to version 2.5.0.
- Update readme file for compatibility with ClassicPress Directory.
- Update readme files.
- Update language template.
- Fix bug with azurecurve menu.
- Update azurecurve menu.
- Update readme files.
- Remove unused jQuery.
- Update azurecurve menu and logo.
- Fix plugin action link to use admin_url() function.
- Rewrite option handling so defaults not stored in database on plugin initialisation.
- Add plugin icon and banner.
- Update azurecurve plugin menu.
- Amend to only load css when shortcode on page.
- Fix bug with setting of default options.
- Fix bug with plugin menu.
- Update plugin menu css.
- Rewrite default option creation function to resolve several bugs.
- Upgrade azurecurve plugin to store available plugins in options.
- Update Update Manager class to v2.0.0.
- Update action link.
- Update azurecurve menu icon with compressed image.
- Fix bug with incorrect language load text domain.
- Add integration with Update Manager for automatic updates.
- Fix issue with display of azurecurve menu.
- Change settings page heading.
- Add load_plugin_textdomain to handle translations.
- Update azurecurve menu for easier maintenance.
- Move require of azurecurve menu below security check.
- Initial release.
azurecurve was one of the first plugin developers to start developing for ClassicPress; all plugins are available from azurecurve Development and are integrated with the Update Manager plugin for fully integrated, no hassle, updates.
The plugins available from azurecurve are:
- Add Open Graph Tags – details / download
- Add Twitter Cards – details / download
- Avatars – details / download
- BBCode – details / download
- Breadcrumbs – details / download
- Broken Links – details / download
- Call-out Boxes – details / download
- Chroma – details / download
- Code – details / download
- Comment Validator – details / download
- Conditional Links – details / download
- Contact Forms – details / download
- Disable FLoC – details / download
- Display After Post Content – details / download
- Estimated Read Time – details / download
- Events – details / download
- Feed to Post – details / download
- Filtered Categories – details / download
- Flags – details / download
- Floating Featured Image – details / download
- Get GitHub File – details / download
- Icons – details / download
- Image Optimiser – details / download
- Images – details / download
- Insult Generator – details / download
- Load Admin CSS – details / download
- Loop Injection – details / download
- Lorem Ipsum Generator – details / download
- Maintenance Mode – details / download
- Markdown – details / download
- Nearby – details / download
- Page Index – details / download
- Post Archive – details / download
- Quiz Engine – details / download
- Read GitHub File – details / download
- Redirect – details / download
- Remove Revisions – details / download
- RSS Feed – details / download
- RSS Suffix – details / download
- Series Index – details / download
- Shortcodes in Comments – details / download
- Shortcodes in Widgets – details / download
- SMTP – details / download
- Snippets – details / download
- String Inspector – details / download
- Strong Password Generator – details / download
- Tag Cloud – details / download
- Taxonomy Index – details / download
- Taxonomy Order – details / download
- Theme Switcher – details / download
- Timelines – details / download
- Toggle Show/Hide – details / download
- Update Admin Menu – details / download
- URL Shortener – details / download
- Username Protection – details / download
- View Counter – details / download
- Widget Announcements – details / download