Arkadaşlar selamlar,
Wordpress Dipnot Rakamı başına [] ifadesi nasıl koyarım dosya nerede bir türlü bulamadım.
Şimdiden teşekkürler.
Wordpress Dipnot Rakamı başına [] ifadesi
6
●94
- 04-10-2024, 12:12:45
- 04-10-2024, 12:50:44tema function a yapıştır
function custom_editor_script() { ?> <script type="text/javascript"> document.addEventListener('DOMContentLoaded', function () { if (typeof wp !== 'undefined' && typeof wp.data !== 'undefined') { wp.data.subscribe(function () { const blocks = wp.data.select('core/block-editor').getBlocks(); blocks.forEach(block => { if (block.name === 'core/footnote') { let newContent = `[${block.attributes.content}]`; if (block.attributes.content !== newContent) { wp.data.dispatch('core/block-editor').updateBlockAttributes(block.clientId, { content: newContent }); } } }); }); } }); </script> <?php } add_action('admin_footer', 'custom_editor_script'); - 04-10-2024, 17:20:37function custom_tinymce_settings($initArray) {
$initArray['setup'] = 'function(editor) {
editor.on("keypress", function(event) {
if (event.charCode >= 49 && event.charCode <= 57 && event.shiftKey == false) { // 1 to 9 keys
var content = editor.getContent();
editor.setContent(content.replace(/(d)/g, "[$1]"));
}
});
}';
return $initArray;
}
add_filter('tiny_mce_before_init', 'custom_tinymce_settings');
Bunu deneyin. - 04-10-2024, 17:24:50Eklenti ile çözüm düşünülürse: https://wordpress.org/plugins/footnotes-made-easy/
