Skip to content

Commit

Permalink
release: version 2.2.2
Browse files Browse the repository at this point in the history
- Fix Social Sharing Links When Used with FSE
- Fix the Compatibility of the Posts Block with FIFU Plugin
- Fix Animation Module Breaking FSE Mobile Menu
- Fix Section Block Breaking When Changing Theme
- Simplify Dynamic Value Preview
- Copy Animations with Copy-paste Style
  • Loading branch information
HardeepAsrani authored Feb 6, 2023
2 parents 06a78af + 862df2d commit 45915a2
Show file tree
Hide file tree
Showing 24 changed files with 486 additions and 99 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions inc/class-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public function enqueue_block_editor_assets() {
'isAncestorTypeAvailable' => version_compare( get_bloginfo( 'version' ), '5.9.22', '>=' ),
'version' => OTTER_BLOCKS_VERSION,
'isRTL' => is_rtl(),
'highlightDynamicText' => get_option( 'themeisle_blocks_settings_highlight_dynamic', true ),
)
);

Expand Down
11 changes: 11 additions & 0 deletions inc/plugins/class-options-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ public function register_settings() {
)
);

register_setting(
'themeisle_blocks_settings',
'themeisle_blocks_settings_highlight_dynamic',
array(
'type' => 'boolean',
'description' => __( 'Easily differentiate between dynamic and normal text in the editor.', 'otter-blocks' ),
'show_in_rest' => true,
'default' => true,
)
);

register_setting(
'themeisle_blocks_settings',
'themeisle_blocks_settings_optimize_animations_css',
Expand Down
30 changes: 22 additions & 8 deletions inc/render/class-sharing-icons-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,58 @@ class Sharing_Icons_Block {
/**
* Return attributes for social media services.
*
* @param string|null $context Context of the sharing icons block.
*
* @return array
*/
public static function get_social_profiles() {
public static function get_social_profiles( $context = null ) {
$current_url = home_url( add_query_arg( null, null ) );
$title = get_the_title( get_queried_object_id() );

if ( is_archive() ) {
$title = get_the_archive_title();
} elseif ( 'query' === $context ) {
$current_url = get_the_permalink();
$title = get_the_title();
} elseif ( null === get_queried_object() && is_home() ) {
$title = get_bloginfo( 'name' );
}

$social_attributes = array(
'facebook' => array(
'label' => esc_html__( 'Facebook', 'otter-blocks' ),
'icon' => 'facebook-f',
'url' => 'https://www.facebook.com/sharer/sharer.php?u=' . esc_url( get_the_permalink() ) . '&title=' . esc_attr( get_the_title() ),
'url' => 'https://www.facebook.com/sharer/sharer.php?u=' . esc_url( $current_url ) . '&title=' . esc_attr( $title ),
),

'twitter' => array(
'label' => esc_html__( 'Twitter', 'otter-blocks' ),
'icon' => 'twitter',
'url' => 'http://twitter.com/share?url=' . esc_url( get_the_permalink() ) . '&text=' . esc_attr( get_the_title() ),
'url' => 'http://twitter.com/share?url=' . esc_url( $current_url ) . '&text=' . esc_attr( $title ),
),

'linkedin' => array(
'label' => esc_html__( 'Linkedin', 'otter-blocks' ),
'icon' => 'linkedin-in',
'url' => 'https://www.linkedin.com/shareArticle?mini=true&url=' . esc_url( get_the_permalink() ) . '&title=' . esc_attr( get_the_title() ),
'url' => 'https://www.linkedin.com/shareArticle?mini=true&url=' . esc_url( $current_url ) . '&title=' . esc_attr( $title ),
),

'pinterest' => array(
'label' => esc_html__( 'Pinterest', 'otter-blocks' ),
'icon' => 'pinterest-p',
'url' => 'https://pinterest.com/pin/create/button/?url=' . esc_url( get_the_permalink() ) . '&description=' . esc_attr( get_the_title() ),
'url' => 'https://pinterest.com/pin/create/button/?url=' . esc_url( $current_url ) . '&description=' . esc_attr( $title ),
),

'tumblr' => array(
'label' => esc_html__( 'Tumblr', 'otter-blocks' ),
'icon' => 'tumblr',
'url' => 'https://tumblr.com/share/link?url=' . esc_url( get_the_permalink() ) . '&name=' . esc_attr( get_the_title() ),
'url' => 'https://tumblr.com/share/link?url=' . esc_url( $current_url ) . '&name=' . esc_attr( $title ),
),

'reddit' => array(
'label' => esc_html__( 'Reddit', 'otter-blocks' ),
'icon' => 'reddit-alien',
'url' => 'https://www.reddit.com/submit?url=' . esc_url( get_the_permalink() ),
'url' => 'https://www.reddit.com/submit?url=' . esc_url( $current_url ),
),
);

Expand Down Expand Up @@ -82,7 +96,7 @@ private function is_active( $icon ) {
* @return mixed|string
*/
public function render( $attributes ) {
$social_attributes = $this->get_social_profiles();
$social_attributes = $this->get_social_profiles( isset( $attributes['context'] ) ? $attributes['context'] : null );

$class = '';

Expand Down
Loading

0 comments on commit 45915a2

Please sign in to comment.