Matt
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Tooltips in widgets broken in 2.2I cannot as I am developing a new site that isn’t accessible externally yet. I did try adding the actual widget and it did not work either.
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Add "widget" to display optionsThat’s why I was hoping you could implement it into future release =D. Why not provide the additional option? Failing to see any negative to it.
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Tooltips in widgets broken in 2.2Figured out a way to loop through widget data to provide a permanent fix. This will make it still only load scripts when necessary and will only check widget data when not found in post data. The only thing I’m not sure of is if a home page is set to “static,” will “add_filter( ‘the_posts’, array( $this, ‘load_scripts’ ) );” still fire? I assume so. Anyways, here is my fix:
First the function to check the widget data. I inserted this just above the load_scripts function:
public function active_in_widget() { global $wp_registered_widgets; $active_widgets = get_option( 'sidebars_widgets' ); foreach ( $active_widgets as $sidebar_name => $sidebar_widgets ) { if ($sidebar_name != 'wp_inactive_widgets' && !empty($sidebar_widgets) && is_array($sidebar_widgets)) { foreach ($sidebar_widgets as $widget_instance) { $widget_class = $wp_registered_widgets[$widget_instance]['callback'][0]->option_name; $instance_id = $wp_registered_widgets[$widget_instance]['params'][0]['number']; $widget_data = get_option($widget_class); if (!empty($widget_data[$instance_id]['text'])) { if (stripos( $widget_data[$instance_id]['text'], '[gcal' ) !== false) return TRUE; } } } } return FALSE; }
And then the modification to load_scripts:
public function load_scripts( $posts ) { $load_scripts = FALSE; if ( !empty( $posts ) ) { foreach ( $posts as $post ){ if ( ( strpos( $post->post_content, '[gcal' ) !== false ) || ( $post->post_type == 'gce_feed' ) ) { $load_scripts = TRUE; break; } } } if (!$load_scripts) { if ($this->active_in_widget()) $load_scripts = TRUE; } if ($load_scripts) { // Load CSS wp_enqueue_style( $this->plugin_slug . '-public' ); // Load JS wp_enqueue_script( $this->plugin_slug . '-public' ); $this->show_scripts = true; } return $posts; }
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Add "widget" to display optionsThe issue for me was the height of the containing box. I like how with the widget styling it’s condensed and small. I also use display=”grid” on other pages and like the styling of those as they are. I would have to add extra css styling for something like “.widget .gce-page-grid” but .gce-widget-grid already has the exact styling I want.
Seems easy enough to implement my code fix, no?
Forum: Plugins
In reply to: [Simple Calendar - Google Calendar Plugin] Add "widget" to display optionsWow I just went back to read this and I butchered the hell out of this post. I meant to say, “I recently had a need to customize the widget…” and then “I was hoping I could do ‘display=widget‘” (not grid, which obviously works). Either way, the fix I posted does work and enbles display=widget as an option.
Forum: Plugins
In reply to: [WP Media Cleaner] Scanning sites folder on multisiteLine 383 in wp-media-cleaner.php. If you search for “$wpmc_exclude_dir” it’s the first match.
$wpmc_exclude_dir = array( ".", "..", "wpmc-trash", ".htaccess", "ptetmp", "profiles", "sites" );
Forum: Plugins
In reply to: [Responsive Lightbox & Gallery] Problem with add_gallery_lightbox_selectorThis did not got fixed in your latest version.
Forum: Plugins
In reply to: [Media Library Assistant] Started getting this ambiguous sql errorwow, ok. I tracked it back even further to another custom function that I wrote where I was hooking “pre_get_posts” to add pages to the loop, but only if they were 1 month old or newer. I just had to modify that query to include the table name ($wpdb->prefix.’posts’). I guess you are also hooking that somewhere? Either way, ignore my ramblings I suppose ??
Forum: Plugins
In reply to: [Media Library Assistant] Started getting this ambiguous sql errorfyi– i tried updating to the latest development version and it did not fix it.
Forum: Plugins
In reply to: [Media Library Assistant] Started getting this ambiguous sql errorSo it is being caused by the shortcode I thought it was, but not when displayed directly on the page. It’s being caused by a custom function I wrote that creates an excerpt from the content of the page when “get_the_excerpt()” returns nothing in a list of recent posts. My function is as follows–
function custom_excerpt_length($length){ $excerpt = do_shortcode( get_the_content() ); $excerpt = strip_tags($excerpt, '<br><li><p>'); $excerpt = str_ireplace(array('<br>'), array(', '), $excerpt); $excerpt = str_ireplace(array('<li>','</li>'), array(', ', ''), $excerpt); $excerpt = str_ireplace(array('<p>','</p>'), array(', ', ''), $excerpt); while (substr($excerpt, 0, 1) == ',') { $excerpt = substr($excerpt, 1); } $excerpt = trim($excerpt); if (strlen($excerpt) > $length) { $permalink = get_permalink(); $excerpt = substr($excerpt, 0, $length); $excerpt = substr($excerpt, 0, strripos($excerpt, " ")); $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt)); $excerpt = $excerpt.'... <a href="'.$permalink.'">more</a>'; } return $excerpt; }
The “$excerpt = do_shortcode( get_the_content() );” is causing it. This is being ran in the loop on a homepage set to show the most recent posts. The shortcode is–
[mla_gallery mla_link_attributes=’rel=”none”‘ attachment_category=board-governance mla_style=mla-policy-list-ul mla_markup=mla-policy-list-ul post_parent=all orderby=title order=asc post_mime_type=all link=file]
Forum: Plugins
In reply to: [Media Library Assistant] Started getting this ambiguous sql errorpost edited — I was wrong, the shortcode i originally posted was not causing this. trying to figure out what is.
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Problem with relevanssi_do_not_index filterI think I identified the problem. In ‘relevanssi_index_doc’ you have the following:
if (true == apply_filters('relevanssi_do_not_index', false, $post->ID)) { // filter says no if ($post_was_null) $post = null; if ($previous_post) $post = $previous_post; $index_this_post = false; } if ($remove_first) { // we are updating a post, so remove the old stuff first relevanssi_remove_doc($post->ID, true); if (function_exists('relevanssi_remove_item')) { relevanssi_remove_item($post->ID, 'post'); } }
Since I’m dealing with an attachment here, and I’m uploading the attachment via the media library section on the dashboard (not from a post or page), the global $post would be null and therefor gets set back to null with “if ($post_was_null) $post = null;”.
Then during second part you aren’t checking the status of $post. Nor do you do so within the relevanssi_remove_doc function. So $post->ID gets passed through as null.
I modified the code to this for now on my end–
if ($remove_first && !empty($post->ID)) { // we are updating a post, so remove the old stuff first relevanssi_remove_doc($post->ID, true); if (function_exists('relevanssi_remove_item')) { relevanssi_remove_item($post->ID, 'post'); } }
bump
Forum: Plugins
In reply to: [Broken Link Checker] Option to recheck page instead of linkI’m anal and when I fix a link I want the “bubble” to go away ??
Forum: Plugins
In reply to: [Captcha] Captcha accepts any answer