Skip to content

Commit

Permalink
Merge pull request #905 from Codeinwp/fix/title-with-text-before-tag
Browse files Browse the repository at this point in the history
fix: allow mix content in title field for map content
  • Loading branch information
vytisbulkevicius authored Mar 28, 2024
2 parents e90763a + 1146c23 commit 63a31ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,9 @@ input.fz-switch-toggle[type=checkbox]:checked:before{
}
.fz-form-wrap .tagify__tag{
position: relative;
margin-left: 0;
margin-right: 16px;
margin-bottom: 16px;
margin-left: 2px;
margin-right: 2px;
margin-bottom: 2px;
vertical-align: top;
}
.fz-form-wrap .tagify__tag>div{
Expand Down
3 changes: 3 additions & 0 deletions includes/admin/feedzy-rss-feeds-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,9 @@ private function run_job( $job, $max ) {
$item_date = date( get_option( 'date_format' ) . ' at ' . get_option( 'time_format' ), $item['item_date'] );
$item_date = $item['item_date_formatted'];

// Transform any structure like [[{"value":"[#item_title]"}]] to [#item_title].
$import_title = preg_replace( '/\[\[\{"value":"(\[#[^]]+\])"\}\]\]/', '$1', $import_title );

// Get translated item title.
$translated_title = '';
if ( $import_auto_translation && ( false !== strpos( $import_title, '[#translated_title]' ) || false !== strpos( $post_excerpt, '[#translated_title]' ) ) ) {
Expand Down
7 changes: 6 additions & 1 deletion includes/views/js/import-metabox-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
} );

// Tagify for normal textbox.
$( '.fz-input-tagify:not(.fz-tagify-image)' ).tagify( {
$( '.fz-input-tagify:not(.fz-tagify-image):not([name="feedzy_meta_data[import_post_title]"])' ).tagify( {
editTags: false,
originalInputValueFormat: function( valuesArr ) {
return valuesArr.map( function( item ) {
Expand All @@ -478,6 +478,11 @@
}
} );

// Tagify the title field.
$( '.fz-input-tagify[name="feedzy_meta_data[import_post_title]"]:not(.fz-tagify-image)' ).tagify( {
mode: 'mix'
} );

// Tagify for normal mix content field.
$( '.fz-tagify-image' ).tagify( {
mode: 'mix',
Expand Down

0 comments on commit 63a31ea

Please sign in to comment.