Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} catch ( err ) {
this.setState(
{
isLoading: false,
errorCode: err.code,
errorMsg: err.message,
errorReason: err.data && err.data.reason ? err.data.reason : false,
}
);
}
} else {
await this.getAccounts();
}
// Handle save hook from the settings page.
addFilter( 'googlekit.SettingsConfirmed',
'googlekit.AnalyticsSettingsConfirmed',
( chain, module ) => {
if ( 'analytics' !== module.replace( '-module', '' ) ) {
return chain;
}
const { isEditing } = this.props;
if ( isEditing ) {
return this.handleSubmit();
}
} );
}
/**
* External dependencies
*/
import { omit } from 'lodash'
/**
* WordPress dependencies
*/
import { addFilter } from '@wordpress/hooks'
// Remove text from block designs being applied.
addFilter( 'stackable.icon-list.design.no-text-attributes', 'stackable/icon-list', attributes => {
return omit( attributes, [
'text',
] )
} )
result.error_data[ 403 ].reason
) {
if ( 'insufficientPermissions' === result.error_data[ 403 ].reason ) {
// Insufficient scopes - add a notice.
addFilter( 'googlesitekit.DashboardNotifications',
'googlesitekit.AuthNotification',
fillFilterWithComponent( DashboardAuthAlert ), 1 );
} else if ( 'forbidden' === result.error_data[ 403 ].reason ) {
// Insufficient access permissions - add a notice.
addFilter( 'googlesitekit.DashboardNotifications',
'googlesitekit.AuthNotification',
fillFilterWithComponent( DashboardPermissionAlert ), 1 );
}
// Increase the notice count.
addFilter( 'googlesitekit.TotalNotifications',
'googlesitekit.AuthCountIncrease', ( count ) => {
// Only run once.
removeFilter( 'googlesitekit.TotalNotifications', 'googlesitekit.AuthCountIncrease' );
return count + 1;
} );
}
each( keyIndexesMap[ key ], ( index ) => {
const request = dataRequest[ index ];
this.setCache( request.key, result );
this.resolve( request, result );
} );
}
// Trigger an action indicating this data load completed from the API.
export default store => {
// Hook to `wordlift.AddEntity.preWrapperContainer` in order to display notices.
addFilter("wordlift.AddEntity.beforeWrapperContainer", "wordlift", values => values.concat(<Notice />));
// Hook to `wordlift.AddEntity.preWrapperContainer` in order to display notices.
addFilter("wordlift.AddEntity.afterWrapperContainer", "wordlift", values =>
values.concat(
<Provider store={store}>
<CreateEntityFormContainer />
</Provider>
)
);
};
addFilter(
'blocks.registerBlockType',
'coblocks/AdvancedControls/attributes',
addAttributes
);
addFilter( 'editor.BlockEdit', 'coblocks/advanced', withAdvancedControls );
addFilter(
'blocks.getSaveContent.extraProps',
'coblocks/applySpacingClass',
applySpacingClass
);
addFilter(
'editor.BlockListBlock',
'coblocks/addEditorBlockAttributes',
addEditorBlockAttributes
);
/**
* External dependencies.
*/
import { addFilter } from '@wordpress/hooks';
/**
* Internal dependencies.
*/
import './style.scss';
addFilter( 'carbon-fields.checkbox-field.block', 'carbon-fields/blocks', ( OriginalCheckboxField ) => OriginalCheckboxField );
...customClasses,
] ).join( ' ' );
if ( filteredClassName ) {
blockAttributes.className = filteredClassName;
} else {
delete blockAttributes.className;
}
}
return blockAttributes;
}
addFilter( 'blocks.registerBlockType', 'core/custom-class-name/attribute', addAttribute );
addFilter( 'blocks.getSaveContent.extraProps', 'core/custom-class-name/save-props', addSaveProps );
addFilter( 'blocks.getBlockAttributes', 'core/custom-class-name/addParsedDifference', addParsedDifference );
{
attributes,
isEligible: attrs => ! attrs.guid,
save,
supports,
isDeprecation: true,
},
deprecatedV1,
],
};
}
return settings;
};
addFilter( 'blocks.registerBlockType', 'jetpack/videopress', addVideoPressSupport );
const contentAlign = blockName => {
addFilter( `stackable.${ blockName }.edit.inspector.before`, `stackable/${ blockName }/content-align`, addAlignToolbar, 11 )
addFilter( `stackable.${ blockName }.attributes`, `stackable/${ blockName }/content-align`, addAttributes )
addFilter( `stackable.${ blockName }.styles`, `stackable/${ blockName }/content-align`, addStyles, 9 )
doAction( `stackable.module.content-align`, blockName )
}
* @param {Object} props Additional props applied to save element
* @param {Object} blockType Block type
* @param {Object} attributes Block attributes
* @return {Object} Filtered props applied to save element
*/
export function addAssignedAlign( props, blockType, attributes ) {
const { align } = attributes;
if ( includes( getBlockValidAlignments( blockType ), align ) ) {
props.className = classnames( `align${ align }`, props.className );
}
return props;
}
addFilter( 'blocks.registerBlockType', 'core/align/addAttribute', addAttribute );
addFilter( 'editor.BlockListBlock', 'core/editor/align/with-data-align', withDataAlign );
addFilter( 'editor.BlockEdit', 'core/editor/align/with-toolbar-controls', withToolbarControls );
addFilter( 'blocks.getSaveContent.extraProps', 'core/align/addAssignedAlign', addAssignedAlign );