ປລັກອິນນີ້ ຍັງບໍ່ທັນໄດ້ຮັບການທົດສອບກັບ WordPress 3 ເວີຊັນຫຼັກຫຼ້າສຸດ. ມັນອາດຈະບໍ່ໄດ້ຮັບການເບິ່ງແຍງ ຫຼື ສະໜັບສະໜູນອີກຕໍ່ໄປ ແລະ ອາດມີບັນຫາການເຮັດວຽກຮ່ວມກັນເມື່ອໃຊ້ກັບ WordPress ເວີຊັນທີ່ໃໝ່ກວ່າ.

WP ragadjust

ຄຳອະທິບາຍ

WP ragadjust is an extremely simple plugin that includes ragadjust.js on your web pages. Ragadjust.js is a script written by @nathanford and envisaged by @markboulton which resolves several typographical violations relating to the rag that are common on the web:

  • Line breaks immediately following a preposition
  • Line breaks immediately following a dash
  • Small words at the end of a line
  • Consecutive hyphenation
  • (Line) broken, short emphasised phrases

Solving these issues improves the overall readability of your content.

Read the article behind the idea.

ພາບໜ້າຈໍ

  • Before / After ragadjust.

ການຕິດຕັ້ງ

  1. Upload wp-ragadjust to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Done!

ຄຳຖາມທີ່ພົບເລື້ອຍ

Which elements are _ragadjust_ed by default?

By default ragajust is applied to p tags.

Can I change which elemnts are adjusted?

Yes, you can use the wpr_elements filter to make adjustments to the selectors.

To add a new selector:

add_filter( 'wpr_elements', 'wpr_new_selectors' );
function wpr_new_selectors( $elements ) {
    $elements[] .= '.textwidget'; // Adjust text widgets in addition to p
    return $elements;
}

To remove a current selector:

add_filter( 'wpr_elements', 'wpr_remove_elements' );
function wpr_remove_elements( $elements ) {
    unset( $elements['0'] ); // Unset 'p'.
    return $elements;
}

To use your own, entirely unique selectors:

add_filter( 'wpr_elements', 'wpr_custom_elements' );
function wpr_custom_elements( $elements ) {
    $elements = array(
            'article',
            'footer',
        );
    return $elements;
}

These snippets should go in your child themes functions.php file.

Can I change the method used?

Yes. By default all methods will be used to fix all violations. If however you only want to fix prepositions and ignore everything else you can do so via the wpr_method filter like so:

add_filter( 'wpr_method', 'wpr_custom_method' );
function wpr_custom_method( $method ) {
    $method = 'prepositions';
    return $method;
}

The method options are:

  • emphasis – Text of three or less words in bold or italics does not break across lines.
  • small-words – Breaks lines before words of three or less characters.
  • prepositions – Breaks lines before prepositions.
  • dashes – Breaks lines before hyphens and dashes.
  • all (default) – All of the above.

ການຣີວິວ

3 ກັນຍາ 2016
Makes pages more readable. 🙂
ອ່ານການຣີວິວທັງໝົດ 5 ລາຍການ

ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ

“WP ragadjust” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

ແປ “WP ragadjust” ເປັນພາສາຂອງເຈົ້າ.

ສົນໃຈຮ່ວມພັດທະນາບໍ່?

ເບິ່ງລະຫັດ, ກວດເບິ່ງ ຄັງເກັບ SVN, ຫຼື ຕິດຕາມ ບັນທຶກການພັດທະນາ ຜ່ານ RSS.

ບັນທຶກການປ່ຽນແປງ

1.0.0

Initial release.