Quote from: MelWilson on Jul 30, 2024, 10:17 AMQuote from: Mathew on Jul 30, 2024, 10:15 AM@Jack transparency is key, but let's be real—these companies will fight tooth and nail to keep their algorithms secret. They claim it's for competitive reasons, but we all know it's really about maintaining control. I think a more aggressive approach might be necessary. Maybe we need to bring in anti-trust laws and break them up, similar to what was done with Standard Oil back in the day. It's not going to be easy, but we need to take back control.
@Mathew I'm actually a lawyer, and I've studied anti-trust laws extensively. You're right; breaking up these tech giants won't be easy, but it is possible. The government just needs the will to act. One of the biggest challenges will be proving that these companies have a monopoly and that they are using it to manipulate information and stifle competition. Public pressure is crucial here. If enough people get angry and demand change, the politicians will have to listen.
Quote from: Mathew on Jul 30, 2024, 10:15 AM@Jack transparency is key, but let's be real—these companies will fight tooth and nail to keep their algorithms secret. They claim it's for competitive reasons, but we all know it's really about maintaining control. I think a more aggressive approach might be necessary. Maybe we need to bring in anti-trust laws and break them up, similar to what was done with Standard Oil back in the day. It's not going to be easy, but we need to take back control.
// Hook into the save_post action
add_action('save_post', 'save_custom_gtin_field');
function save_custom_gtin_field($post_id) {
// Check if the post type is 'product'
if (get_post_type($post_id) == 'product') {
// Check if the Yoast GTIN field is set
if (isset($_POST['_yoast_wpseo_gtin'])) {
// Get the GTIN value
$gtin = sanitize_text_field($_POST['_yoast_wpseo_gtin']);
// Save the GTIN value into the _woosea_gtin field
update_post_meta($post_id, '_woosea_gtin', $gtin);
}
}
}
// Hook into the save_post action for syncing fields
add_action('save_post', 'sync_gtin_fields');
function sync_gtin_fields($post_id) {
// Check if the post type is 'product'
if (get_post_type($post_id) == 'product') {
// Get the GTIN values from both fields
$yoast_gtin = get_post_meta($post_id, '_yoast_wpseo_gtin', true);
$woosea_gtin = get_post_meta($post_id, '_woosea_gtin', true);
// Update the _woosea_gtin field if it's different from Yoast's field
if ($yoast_gtin && $yoast_gtin !== $woosea_gtin) {
update_post_meta($post_id, '_woosea_gtin', $yoast_gtin);
}
// Optionally, update Yoast's field if it's different from _woosea_gtin field
if ($woosea_gtin && $woosea_gtin !== $yoast_gtin) {
update_post_meta($post_id, '_yoast_wpseo_gtin', $woosea_gtin);
}
}
}
UPDATE wp_postmeta
SET meta_value = (
SELECT meta_value
FROM wp_postmeta AS pm2
WHERE pm2.post_id = wp_postmeta.post_id
AND pm2.meta_key = '_woosea_gtin'
)
WHERE meta_key = '_yoast_gtin';