Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CSS selector keyword to scope and description #374

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/ppom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ function inline_css() {

if ( $this->ppom_settings->productmeta_style != '' ) {
$inline_css = stripslashes( strip_tags( $this->ppom_settings->productmeta_style ) );
$inline_css = str_replace( 'selector', ".ppom-id-$this->meta_id", $inline_css );
}

return apply_filters( 'ppom_inline_css', $inline_css, $this );
Expand Down
10 changes: 7 additions & 3 deletions templates/admin/ppom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$send_file_attachment = ( isset( $ppom_settings->send_file_attachment ) ? $ppom_settings->send_file_attachment : '' );
$show_cart_thumb = ( isset( $ppom_settings->show_cart_thumb ) ? $ppom_settings->show_cart_thumb : '' );
$aviary_api_key = ( isset( $ppom_settings->aviary_api_key ) ? $ppom_settings->aviary_api_key : '' );
$productmeta_style = ( isset( $ppom_settings->productmeta_style ) ? $ppom_settings->productmeta_style : '' );
$productmeta_style = ! empty( $ppom_settings->productmeta_style ) ? $ppom_settings->productmeta_style : "selector {\n}\n";
$productmeta_js = ( isset( $ppom_settings->productmeta_js ) ? $ppom_settings->productmeta_js : '' );
$productmeta_categories = ( isset( $ppom_settings->productmeta_categories ) ? $ppom_settings->productmeta_categories : '' );
$product_meta = json_decode( $ppom_settings->the_meta, true );
Expand Down Expand Up @@ -197,8 +197,12 @@ class="dashicons dashicons-editor-help"></i></span>
title="<?php _e( 'Add your own CSS.', 'woocommerce-product-addon' ); ?>"><i
class="dashicons dashicons-editor-help"></i></span>
</label>
<textarea id="ppom-css-editor" class="form-control"
name="productmeta_style"><?php echo wp_unslash( $productmeta_style ); ?></textarea>
<textarea id="ppom-css-editor" class="form-control" name="productmeta_style"><?php echo wp_unslash( $productmeta_style ); ?></textarea>
<br>
<p><?php esc_html_e( 'Use', 'woocommerce-product-addon' ); ?> <code>selector</code> <?php esc_html_e( 'to target block wrapper.', 'woocommerce-product-addon' ); ?></p>
<p><?php esc_html_e( 'Example:', 'woocommerce-product-addon' ); ?></p>
<pre className="ppom-css-editor-help"><?php echo esc_html( "selector {\n background: #000;\n}\nselector img {\n border-radius: 100%;\n}" ); ?></pre>
<p><?php esc_html_e( 'You can also use other CSS syntax here, such as media queries.', 'woocommerce-product-addon' ); ?></p>
</div>
</div>
<div class="col-md-6 col-sm-12">
Expand Down
Loading