/nbsp-french

JSM's Non-Breaking Space for French Content (WordPress Plugin)

Primary LanguagePHP

JSM's Non-Breaking Space for French Content

Plugin NameJSM's Non-Breaking Space for French Content
SummaryAdds a non-breaking space between words and punctuation marks to avoid inappropriate line-breaks in French.
Stable Version1.10.0
Requires PHP5.6 or newer
Requires WordPress4.2 or newer
Tested Up To WordPress5.4.1
Contributorsjsmoriss
LicenseGPLv3
Tags / Keywordsnon-breaking, french, content, line-break, punctuation, space, new line, line break

Description

This plugin adds non-breaking spaces required by the French language in the content, excerpt, comments, text widget, and WooCommerce short description — skipping over pre-formatted code blocks, styles and scripts.

If the <!--:fr--> HTML tag is found (used by some multilingual plugins), non-breaking spaces are added only between the <!--:fr--> and <!--:--> HTML tags.

There are no plugin settings — simply install and activate the plugin.

Filters for Developers

'nbsp_french_add_filters' ( array $filter_names )

An associative array of filter names (and priority) for the plugin to hook.

array(
    'the_title'                     => 10,
    'the_content'                   => 10,
    'the_excerpt'                   => 10,
    'comment_text'                  => 10,
    'widget_title'                  => 10,
    'widget_text'                   => 10,
    'woocommerce_short_description' => 10,
)

To hook additional filters, include their names (and priority) in the 'nbsp_french_add_filters' array, or hook them individually in your functions.php:

add_filter( 'another_text_filter_name',
    array( 'NbspFrench', 'filter' ), 10, 1 );

'nbsp_french_currencies' ( $regex )

A regular expression of recognized currency symbols.

Installation

Automated Install

  1. Go to the wp-admin/ section of your website.
  2. Select the Plugins menu item.
  3. Select the Add New sub-menu item.
  4. In the Search box, enter the plugin name.
  5. Click the Search Plugins button.
  6. Click the Install Now link for the plugin.
  7. Click the Activate Plugin link.

Semi-Automated Install

  1. Download the plugin ZIP file.
  2. Go to the wp-admin/ section of your website.
  3. Select the Plugins menu item.
  4. Select the Add New sub-menu item.
  5. Click on Upload link (just under the Install Plugins page title).
  6. Click the Browse... button.
  7. Navigate your local folders / directories and choose the ZIP file you downloaded previously.
  8. Click on the Install Now button.
  9. Click the Activate Plugin link.

Frequently Asked Questions