CompassBlocks
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Ads – Ad Manager & AdSense] Center Various Logo Sizes In A GridDid the css you tried use the A tag to wrap the border around?
Ive used your plugin on a dozens sites but right now I cannot get the api to work.
all I get when I save the settings page isError: Your Google API Key is not valid for this request and permission is denied. Please check your Google API Key.
The error message indicates a conflict in the function declarations between two plugins related to PDF invoices in WooCommerce. Specifically, it mentions the
ADQ_PDF_Invoicesclass and theOrder_Documentclass from thewoocommerce-quotationplugin. The issue lies in the methodget_settingshaving incompatible signatures in these two classes.Here’s a breakdown of the conflicting declarations:
- ADQ_PDF_Invoices::get_settings($latest = false)
- WPO\WC\PDF_Invoices\Documents\Order_Document::get_settings($latest = false, $output_format = ‘pdf’)
The error occurs because the
ADQ_PDF_Invoicesclass does not include the$output_formatparameter in itsget_settingsmethod, while theOrder_Documentclass does.To resolve this issue, you need to modify the
ADQ_PDF_Invoicesclass to match the signature of theOrder_Documentclass. Specifically, you should update theget_settingsmethod inADQ_PDF_Invoicesto include the$output_formatparameter.Here’s the problematic part in your file:
public function get_settings($latest = false) { // Your existing code }Change it to:
public function get_settings($latest = false, $output_format = 'pdf') { // Your existing code, adjusted if necessary to handle the $output_format parameter }By adding the
$output_formatparameter with a default value, you align the method signature with the expected one inOrder_Document, resolving the PHP warning.Solution. Most user names automatically have a website listed in their profile. Remove this if you want the author name to link to their profile
Your importer to the new plugin was brilliant. All fixed !!
<?php /** * Plugin Name: Custom links in Elementor Image Carousel * Description: Add custom links in Elementor Image Carousel widget * Version: 1.1.2 * Requires at least: 5.2 * Requires PHP: 7.2 * Author: Charlie Etienne * Author URI: https://web-nancy.fr * License: GPL v2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: custom-links-eicw * Domain Path: /languages */ if ( ! defined( 'ABSPATH' ) ) { exit; } class CustomLinksEICW { private static $instance; final public static function get_instance(): CustomLinksEICW { if (null === self::$instance) { self::$instance = new self(); } return self::$instance; } public function init() { add_filter( 'attachment_fields_to_edit', [ $this, 'attachment_fields_to_edit' ], 10, 2 ); add_filter( 'attachment_fields_to_save', [ $this, 'attachment_fields_to_save' ], 10, 2 ); add_action( 'elementor/frontend/widget/before_render', [ $this, 'modify_carousel_settings' ] ); } /** * Adds 'elementor_carousel_custom_link' field to attachment * * @param $form_fields * @param $post * * @return array */ public function attachment_fields_to_edit( $form_fields, $post ): array { $form_fields[ 'elementor_carousel_custom_link' ] = array( 'label' => __( 'Custom link', 'elementor' ), 'input' => 'text', 'value' => get_post_meta( $post->ID, 'elementor_carousel_custom_link', true ), 'helps' => __( 'This will add a link to images in Elementor Carousel', 'elementor' ), ); $target = (bool) get_post_meta( $post->ID, 'elementor_carousel_custom_link_target', true ); $checked = ( $target ) ? 'checked' : ''; $form_fields[ 'elementor_carousel_custom_link_target' ] = array( 'label' => __( 'Open in new tab ?', 'elementor' ), 'input' => 'html', 'html' => "<input type='checkbox' $checked name='attachments[$post->ID][elementor_carousel_custom_link_target]' id='attachments[$post->ID][elementor_carousel_custom_link_target]' />", 'value' => $target, 'helps' => __( 'Open custom link in Elementor Carousel in new tab ?', 'elementor' ), ); return $form_fields; } /** * Saves 'elementor_carousel_custom_link' field to attachment * * @param $post * @param $attachment * * @return WP_Post|array|null */ public function attachment_fields_to_save( $post, $attachment ) { $attachment_link = $attachment[ 'elementor_carousel_custom_link' ]; $formated_link = $attachment_link ?? ''; update_post_meta( $post[ 'ID' ], 'elementor_carousel_custom_link', $formated_link ); $link_target = isset( $attachment[ 'elementor_carousel_custom_link_target' ] ) ? 1 : 0; update_post_meta( $post[ 'ID' ], 'elementor_carousel_custom_link_target', $link_target ); return $post; } /** * Modify Carousel settings */ public function modify_carousel_settings( $widget ) { if ( 'image-carousel' !== $widget->get_name() ) { return; } $settings = $widget->get_settings_for_display(); $slides = $settings['carousel_images']; if ( ! $slides || empty( $slides ) ) { return; } $slides_with_links = []; foreach ( $slides as $index => $attachment ) { $link_url = get_post_meta( $attachment['id'], 'elementor_carousel_custom_link', true ); $link_target = (bool) get_post_meta( $attachment['id'], 'elementor_carousel_custom_link_target', true ); $attachment['url'] = ! empty( $link_url ) ? $link_url : ''; $attachment['is_external'] = $link_target; $slides_with_links[ $index ] = $attachment; } $widget->set_settings( 'carousel_images', $slides_with_links ); } } CustomLinksEICW::get_instance()->init();Im working on a fix. I dont think its right yet.
- This reply was modified 3 years, 1 month ago by CompassBlocks.
Forum: Plugins
In reply to: [Custom links in Elementor Image Carousel] next prev icons don’t showIm working on a fix. Hopefully I can do this.
- This reply was modified 3 years, 1 month ago by CompassBlocks.
I didn’t do anything different from usual but I just deleted all the reoccurrence of the event and created it again with a slightly different title and its all working. 2023-02-22_15-24-43 (screencast.com)
https://independentplayers.org/ This is the site.
Works on microsoft edge but not on brave or firefox for me.
I have no clue where to go with this. I was inspired by nascar which uses a 3rd party calendar service. They have a +calendar icon that opens a modal and lets people select categories of events to subscribe to. The events calendar can do this if we can output this list with the subscribe links.
https://www.nascar.com/nascar-cup-series/2022/schedule/#Forum: Plugins
In reply to: [The Events Calendar] Hide time on all day eventsThe standard List layout displays 12:00 AM for all day events. V2/list/event/date-tag Does not filter these all day events correctly.
You need to add
$is_all_day = tribe_event_is_all_day( $event_id );<?php if ( ! $is_all_day ) : ?> <?php echo esc_html( $event_day_hour); ?> <?php endif; ?>- This reply was modified 4 years, 3 months ago by CompassBlocks.
To help find the relevant code – This is what creates the subscribe button so look around the subscribe-links pages for the code to use.
the-events-calendar/src/views/v2/compenents/subscribe-links/list.php<?php foreach ( $items as $item ) : ?> <?php $this->template( 'components/subscribe-links/item', [ 'item' => $item ] ); ?> <?php endforeach; ?>https://stackoverflow.com/questions/39652122/how-to-list-all-category-from-custom-post-type
Im following these suggestions to get an array of custom post type categories. In this case its ‘taxonomy’ => ‘tribe_events_cat’,I need to output a list and inside each
- item it will include the category name and the subscribe button for that category.
On the demo you can see the subscribe button at the bottom right https://demo.theeventscalendar.com/events/category/live-events/
It Should look like this in the end https://www.screencast.com/t/ksIt2UEbt
- This reply was modified 4 years, 3 months ago by CompassBlocks.
Im trying to figure out how to first grab an array of categories and then grab the subscribe code which is usual on a individual category page
<?php $args = array( 'taxonomy' => 'tribe_events_cat', 'orderby' => 'name', 'order' => 'ASC' ); $cats = get_categories($args); foreach($cats as $cat) { ?> <a href="<?php echo get_category_link( $cat->term_id ) ?>"> <?php echo $cat->name; ?> </a><?php foreach ( $items as $item ) : ?> <?php $this->template( 'components/subscribe-links/item', [ 'item' => $item ] ); ?> <?php endforeach; ?> <?php } ?>