Setting “Open in New Tab” for Link Control to be checked by default

You have to watch editor changes, you can hook the js to ‘enqueue_block_editor_assets’. your-child-theme/js/default-open-in-new-tab.js wp.domReady(() => { //console.log(“Custom script loaded”); const { subscribe } = wp.data; //we want to subscribe to changes of the editor // Helper function to determine if a URL is external const isExternalLink = (url) => { try { const domain … Read more

How to get default variation ID (woocommerce)

Try this code add_filter(‘woocommerce_variable_price_html’, ‘custom_variation_price’, 10, 2); function custom_variation_price( $price, $product ) { $available_variations = $product->get_available_variations(); $selectedPrice=””; $dump = ”; foreach ( $available_variations as $variation ) { // $dump = $dump . ‘<pre>’ . var_export($variation[‘attributes’], true) . ‘</pre>’; $isDefVariation=false; foreach($product->get_default_attributes() as $key=>$val){ // $dump = $dump . ‘<pre>’ . var_export($key, true) . ‘</pre>’; // $dump … Read more

Remove links to the comments section

Add this to your theme functions file: // This will occur when the comment is posted function plc_comment_post( $incoming_comment ) { // convert everything in a comment to display literally $incoming_comment[‘comment_content’] = htmlspecialchars($incoming_comment[‘comment_content’]); // the one exception is single quotes, which cannot be #039; because WordPress marks it as spam $incoming_comment[‘comment_content’] = str_replace( “‘”, ‘&apos;’, … Read more

Permalink issue with new blog posts > getting 301 redirect

Your WordPress site is set up to include the date in the permalink structure for blog posts. To avoid the 301 redirects and have your desired permalink structure https://website.com/sample-post/ In the Permalink Settings page, you’ll see several common options for permalink structures. Choose the Custom Structure option: In the input field, enter /%postname%/ after save … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)