Matthew O'Donnell
Forum Replies Created
-
Oddly I did have a solution, and I swear I even posted it in this topic as it is now marked as resolved. I am currently extremely confused but will go back through my notes as I had a working solution.
And the final code using labels of the taxonomy as header. 408 on wards again.
$catName .= $cat->name; $termstaxonomy = $cat->taxonomy; $taxonomydetails = get_taxonomy($termstaxonomy); $taxonomyname = $taxonomydetails->label; if ($temptermstaxonomy == $termstaxonomy) { $temptermstaxonomy = $termstaxonomy; if ( 0 == $j ) { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } else { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } $i++; } else { echo "<h2>" . __($taxonomyname, 'subscribe2') . "</h2>\r\n"; $temptermstaxonomy = $termstaxonomy; if ( 0 == $j ) { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } else { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } $i++; } }
Hope this helps you as well.
BOOM! and success. For someone who had no clue I am very chuffed with myself.
class-s2-admin.php line 408 on wards.$catName .= $cat->name; $termstaxonomy = $cat->taxonomy; if ($temptermstaxonomy == $termstaxonomy) { $temptermstaxonomy = $termstaxonomy; if ( 0 == $j ) { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } else { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } $i++; } else { echo "<h2>" . __($cat->taxonomy, 'subscribe2') . "</h2>\r\n"; $temptermstaxonomy = $termstaxonomy; if ( 0 == $j ) { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } else { echo "<label><input class=\"checkall_" . $name . "\" type=\"checkbox\" name=\"" . $name . "[]\" value=\"" . $cat->term_id . "\""; if ( in_array($cat->term_id, $selected) || in_array($cat->term_id, $compulsory) ) { echo " checked=\"checked\""; } if ( in_array($cat->term_id, $compulsory) && $name === 'category' ) { echo " DISABLED"; } echo " /> <abbr title=\"" . $cat->slug . "\">" . $catName . "</abbr></label><br />\r\n"; } $i++; } }
Not altered any of the already present code and hook from functions file is also untouched. Works perfectly ??
Hope this helps you as well.*Just working on getting Taxonomy->name instead of slug then it will be perfect.
by using
$termstaxonomy = $cat->taxonomy; if ($temptermstaxonomy == $termstaxonomy) { echo "Condition Met!"; $temptermstaxonomy = $termstaxonomy; } else { echo "Condition Not Met!"; $temptermstaxonomy = $termstaxonomy; }
I can now detect if they belong to same taxonomy without altering any of the core code. I am at the stages of getting the code in the correct places and creating the header/title then will upload finish code and where it is put ??
To update it seems the array_merge doesn’t actually break the link
Killzone: Shadow Fall stdClass Object ( [term_id] => 18 [name] => Killzone: Shadow Fall [slug] => killzone-shadow-fall [term_group] => 0 [term_taxonomy_id] => 18 [taxonomy] => games_titles [description] => [parent] => 0 [count] => 1 [cat_ID] => 18 [category_count] => 1 [category_description] => [cat_name] => Killzone: Shadow Fall [category_nicename] => killzone-shadow-fall [category_parent] => 0 )
as seen above the taxonomy name still exists. Currently experimenting within class-s2-admin lines 409 to 435. Introducing a If statement to foreach gets the taxonomy the term belongs to. Then if the taxonomy matches previous one carry on creating check boxes, then when taxonomy changes introduce a new break/header and carry on as normal again.
Np, Kinda using this as a note base while I update methods I have tried. Currently my theory is matching the parent of the term by a if statement. Then if same parent create a new header once, then if no match create a new header based on new parent. Will Update on results.
Select / Unselect All Killzone: Shadow Fall Sonic Lost World - Deadly Six Edition Sonic Lost World 3DS Sonic Space Migets Sonic the lost world Super Mario 3D World gdggsgdfhdghnvbnvbnhffgvbnvbnvnfgghbfdhf Killzone Sonic the Hedgehog Super Mario Nintendo 3DS Sony ? Playstation 4 Sony Wii U First Person Shooter Platformer
Thats how they are mashed at the moment. When something like:
Game Titles: Killzone: Shadow Fall Sonic Lost World - Deadly Six Edition Sonic Lost World 3DS Sonic Space Migets Sonic the lost world Super Mario 3D World Game Series: gdggsgdfhdghnvbnvbnhffgvbnvbnvnfgghbfdhf Killzone Sonic the Hedgehog Super Mario System Format: Nintendo 3DS Sony ? Playstation 4 Sony Wii U Genre: First Person Shooter Platformer
That is more what I am after. Otherwise is a exetrmely short time it is going to turn into a gigantic wall of mess.
function my_taxonomy_types($taxonomies) { $taxonomies[] = 'games_titles'; $taxonomies[] = 'gaming_series'; $taxonomies[] = 'system_formats'; $taxonomies[] = 'gaming_genres'; return $taxonomies; } add_filter('s2_taxonomies', 'my_taxonomy_types');
That is how they are being added so surely there must be a way to inform Subscribe2 to treat them as separate boxes/groups under a header? Also
'hierarchical' => true,
is part of the taxonomy setups I use and have no problems using them before. It seems to be the code Subscribe2 uses to add them to the options mashing them together without care ?? Anyways been a long day and I appreciate the help. Hopefully tomorrow I can crack it or find a better way to add them to the plugins options.
Thanks again as 70% is better than 0%. Once I sort the groups out the rest should be simple.Yeh been giving this a go past hour or so. Options are appearing in the admin which is cool, but not on dummy account I am using to subscribe. Don’t understand why it wont give the subscriber the choices as shown in admin.
Mind bending when I worked first time then options vanished.
The other issue I can see is they are not grouped when choices are offered and presented in a wall of titles which can be instantly overwhelming.
Also got Uncategorised appearing twice in admin, but again no options offers to subscriber.
But at moment as I cannot get options to appear despite everything set correctly I am left at a loss however did just do the WordPress 3.9 update which might explain behavior.*Edit* Hit the reset and suddenly everything worked. Only issues I got left is:
1)To see if I can create a button that automatically subscribes the user to the term used on the post. Many thanks for help and great plugin.
2)Group the subscription tags under a Title to keep the multiple taxonomies grouped and separate.Thanks for the quick reply.
I read all that yesterday but might be I might still be abit confused.
To better clarify, If they registered then selected say term ‘Sonic the Hedgehog”, Every article which has that term will be emailed per my setup (such as daily/weekly)?If so that is exactly what I require.
Forum: Hacks
In reply to: Getting Slugs of Taxonomy from post to then get custom post.Bypassed using Advanced Custom Fields and a Post Object. Not great as still need to make sure Taxonomy is tracked but hay it works.
Forum: Hacks
In reply to: Getting Slugs of Taxonomy from post to then get custom post.Array ( [post_type] => company_information [post_status] => publish [order] => title [tax_query] => Array ( [0] => Array ( [taxonomy] => game_technologies [field] => slug [terms] => Array ( [0] => havok-physics ) ) ) )
Still having no luck pulling multiple terms from post. Hoping this thread gets a reply soon before I pull my hair out ?? Seem to be only one on forum to have a record of no reply’s to my threads.Forum: Hacks
In reply to: Getting Slugs of Taxonomy from post to then get custom post.It is worth noting that the Tags will always change, aswell as different amounts depending on what has been assigned to the main post as a taxonomy.
Problem is it is always limited to one and i cannot figure out how to get this to work Dynamically. I need to crack this to finish coding website.
<div class="displayed_game_details"><?php echo get_the_term_list( $post->ID, 'industry_aliases', '<li>', '</li><li>', '</li><br></br>'); $parent_term = term_exists( '', 'industry_aliases' ); // array is returned if taxonomy is given $parent_term_id = $parent_term['term_id']; // get numeric term id wp_insert_term( 'Designer', // the term 'industry_experience', // the taxonomy array( 'slug' => 'designer', 'parent'=> $parent_term_id ) );?></div>
Prob waaaaaaaaaay off but gives a idea of what i am trying to achieve.
Forum: Fixing WordPress
In reply to: Custom Taxonomy per catagory? Or grouped under Catagory Taxonomy?Major major major error on my part. Forgot to register Taxonomy to Custom Post Types.