biziclop
Forum Replies Created
-
Forum: Plugins
In reply to: [Classic Editor] Incorporate Classic WidgetsSee the relevant post here:
Opting out of the block-based widgets editor
The block-based widgets editor is enabled in WordPress 5.8 by default. There are several ways to restore the classic editor:
A theme author may include
remove_theme_support('widgets-block-editor')
. Learn more:
https://developer.www.ads-software.com/block-editor/how-to-guides/widgets/opting-out/#using-remove_theme_supportA site administrator may use the new
use_widgets_block_editor
filter. Learn more:
https://developer.www.ads-software.com/block-editor/how-to-guides/widgets/opting-out/#using-a-filterA user may install and activate the Classic Widgets plugin:
https://www.ads-software.com/plugins/classic-widgets/BTW, this is the core of the plugin above:
// Disables the block editor from managing widgets in the Gutenberg plugin. add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' ); // Disables the block editor from managing widgets. add_filter( 'use_widgets_block_editor', '__return_false' );
- This reply was modified 3 years, 4 months ago by biziclop.
Hi, in WordPress there are really two major types: Post-like types (ordinary blog posts, pages, custom post types created by themes/plugins/etc) and Taxonomies (the usual tags, categories and custom taxonomies).
Items of both have names and slugs too. While the post and page listing pages don’t show in the table, they are still editable. You can use the Quick Edit button on the listing page:
https://i.ibb.co/Cs525cp/quick-edit.pngor the normal edit page:
https://i.ibb.co/HVDPCQw/edit-page.png
You may have to enable the Slug in the Screen Options, or just click on the Edit button below the post name next to the Permalink link.Anyway, in both case (posts and taxonomies) WordPress ensures that no two post or category have the same slug (by appending -1) of the same post type or taxonomy type.
While it could be worked around, it’s not exactly trivial.
Maybe you could use
blog
for one language and a synonym for the other, likeposts
,news
,updates
,entries
,articles
,recent
,blag
??- This reply was modified 3 years, 8 months ago by James Huff.
- This reply was modified 3 years, 8 months ago by biziclop.
Forum: Plugins
In reply to: [Unplug Jetpack] Update or closeIt’s a super simple plugin, actually it’s practically a one-liner:
add_action( 'plugins_loaded', function uj_init(){ add_filter( 'jetpack_development_mode', '__return_true' ); });
So it will probably still work for a while.
I am the idiot of the week, I forgot to update admin.js. Here you have another pull request, now it should actually work:
https://github.com/j-ro/Preserved-HTML-Editor-Markup/pull/2
Sorry for the f*ing it up.
Done (I think):
https://github.com/j-ro/Preserved-HTML-Editor-Markup/pull/1Yes, it ignores unnecessary whitespaces, but in this case the plugin removed even the single necessary whitespace, in this case, the newline character. Comments are not whitespaces!
Something like this goes into the visual editor from the html tab, if the whitespace between the words were newlines:
This<!-- -->text<!-- -->doesn't<!-- -->contain<!-- -->any<!-- -->whitespace.
which would be displayed as:
Thistextdoesn'tcontainanywhitespace.
I don’t think it’s the appropriate behavior, that’s why I tried to fix it by adding a single actual whitespace before the helper comment.
That \1 shoud be \n, because \r only made trouble:
$c = preg_replace("/(\r?\n)/", "\n<!--mep-nl-->", $c); //preserve new lines
Forum: Plugins
In reply to: [NextCellent Gallery - NextGEN Legacy] Error: Code 6Hi, this error message is written by
nggAdmin::swfupload_image()
at
/plugins/nextcellent-gallery-nextgen-legacy/admin/functions.php line 1056:// Check the upload if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']) || $_FILES['Filedata']['error'] != 0) return __('Invalid upload. Error Code : ', 'nggallery') . $_FILES['Filedata']['error'];
At php.net see https://www.php.net/manual/en/features.file-upload.errors.php code 6 means this:
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.Maybe your server is misconfigured somehow. Search for UPLOAD_ERR_NO_TMP_DIR for possible solutions.
Forum: Plugins
In reply to: [NextGEN Custom Fields] Plz update supported versionI updated/changed/butchered a few things to get rid of the warnings in
plugins/nextgen-gallery-custom-fields/ngg-custom-fields.php
. Enjoy:Forum: Plugins
In reply to: [Multiple Post Thumbnails] How to get list of all custom thumbnails?multi-post-thumbnails.php contains this line:
add_action("wp_ajax_set-{$this->post_type}-{$this->id}-thumbnail", array($this, 'set_thumbnail'));
Based on this i wrote the following little functions:// returns post type - thumb type pairs add_action( 'init', 'thumblist', 9999 ); function thumblist(){ global $wp_filter; $thumb_types = preg_filter('/^wp_ajax_set-(.*)-thumbnail$/', '$1', array_keys( $wp_filter )); $by_post_type = array(); foreach( array_keys(get_post_types()) as $post_type ){ $by_post_type[ $post_type ] = preg_filter("/^$post_type-(.*)/", '$1', $thumb_types ); }; var_dump( $thumb_types, $by_post_type ); } // returns all MultiPostThumbnails objects add_action( 'init', 'thumblist2', 9999 ); function thumblist2(){ global $wp_filter; $thumb_types = preg_filter('/^(wp_ajax_set-.*-thumbnail)$/', '$1', array_keys( $wp_filter )); $thumbs = array(); foreach( $thumb_types as $thumb_type ) foreach( $wp_filter[ $thumb_type ][10] as $filter ) $thumbs[] = $filter['function'][0]; var_dump( $thumb_types, $thumbs ); } // returns all MultiPostThumbnails objects for a given post type slug function thumbtypes4posttype( $post_type ){ global $wp_filter; $thumb_types = preg_filter("/^(wp_ajax_set-$post_type-.*-thumbnail)$/", '$1', array_keys( $wp_filter )); $thumbs = array(); foreach( $thumb_types as $thumb_type ) foreach( $wp_filter[ $thumb_type ][10] as $filter ) $thumbs[] = $filter['function'][0]; return $thumbs; }
Forum: Plugins
In reply to: [NextCellent Gallery - NextGEN Legacy] Help to restore settingThis warning should be the first sentence on the plugin page with huge red letters, I also ran into it once…
Forum: Plugins
In reply to: [NextCellent Gallery - NextGEN Legacy] Help to restore settingHi, look into the
wp_options
table, NextGen/Cellent’s rows haveoption_name
starting withngg_
. In my table there is only 3 relevant rows,ngg_options
(this contains the actual settings in php-serialized form),ngg_db_version
(=1.8.1
) andngg_next_update
(this is just a timestamp). Good luck!Your code looks like this (verify it in your browser’s inspector:
<div id="ngg-image-1" class="ngg-gallery-thumbnail-box" style="width:25%;">… <div id="ngg-image-2" class="ngg-gallery-thumbnail-box" style="width:25%;">… <div id="ngg-image-3" class="ngg-gallery-thumbnail-box" style="width:25%;">… <div id="ngg-image-4" class="ngg-gallery-thumbnail-box" style="width:25%;">… <br style="clear: both" />
If you look into
nextgen-gallery/view/gallery.php
you will see what creates the line breaks:<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?> <br style="clear: both" /> <?php } ?>
There is also a
style="width:25%;"
at every line. It is from this line:<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
This is probably set at Gallery / Options / Effects at the admin dashboard as a custom code. I hope you realize that 25% means 4 columns ??
Image squeezing is caused by this rule in your css:
.entry-content img, .comment-content img, .widget img { max-width: 97.5%; }
Hi, go to NGGallery’s Gallery settings tab where you will find a “Number of columns” field, set that to zero.
Also, you should remove the
style="width:25%;"
from the.ngg-gallery-thumbnail-box
elements.