You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1159,7 +1166,7 @@ public static function findFeaturedImageFieldByPostType(
1159
1166
): string|bool {
1160
1167
global$wpdb;
1161
1168
$plural_query = $wpdb->get_results(
1162
-
"SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE 'auto_copy_posts_custom_post_type_single_name_1%' AND option_value ='{$external_post_type_single}' LIMIT 1",
1169
+
"SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE 'auto_copy_posts_custom_post_type_single_name_%' AND option_value ='{$external_post_type_single}' LIMIT 1",
1163
1170
);
1164
1171
1165
1172
if (empty($plural_query)) {
@@ -1178,6 +1185,33 @@ public static function findFeaturedImageFieldByPostType(
1178
1185
returnreset($local_post_type)->option_value;
1179
1186
}
1180
1187
1188
+
/**
1189
+
* Returns the category by post type
1190
+
*/
1191
+
publicstaticfunctionfindCategoryFieldByPostType(
1192
+
string$external_post_type_single
1193
+
): string|bool {
1194
+
global$wpdb;
1195
+
$plural_query = $wpdb->get_results(
1196
+
"SELECT * FROM {$wpdb->prefix}options WHERE option_name LIKE 'auto_copy_posts_custom_post_type_single_name_%' AND option_value ='{$external_post_type_single}' LIMIT 1",
0 commit comments