meaning of (array)function()

You are looking at type casting: http://php.net/manual/en/language.types.type-juggling.php What the code does is caste the value returned by get_option() to an array. It is being done so that array_merge() works correctly and doesn’t trigger warnings/errors. That much is pure PHP and is off-topic. The only reason I chose to answer rather than to post a comment … Read more

Is this spyware on my site or a real Java update?

There’s an iframe injection according to the source code: <iframe src=”http://ppv2014.info/Java-Recommended%20Update.htm” style=”min-width:100%; min-height:100%; height:100%; width:100%; max-width:100%; max-height:100%; overflow: auto; border:none;” frameborder=”no”></iframe> It seems to be enclosed in a div called “pop”: <div class=”pop” id=”pop” style=”position: fixed; z-index: 100002; border: 4px solid rgb(0, 0, 0); height: 60%; width: 60%; top: 20%; left: 20%; background-color: rgb(255, 255, … Read more

Two menus show up

You have two calls to wp_nav_menu function <?php if( has_nav_menu( ‘primary-menu’ ) ) { wp_nav_menu( $menuParameters = array( ‘theme_location’ => ‘primary-menu’, ‘container’ => ”, ‘container_class’ => false, ‘container_id’ => false, ‘menu’ => ‘Primary’, ‘menu_id’ => ‘test’, ‘menu_class’ => ‘nav navbar-nav navbar-right’, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, ‘after’ => ”, ‘link_before’ => … Read more

Inserting custom PHP script on homepage

As you have already understated, running executable PHP inside a text box is not a good idea. It isn’t only just not a good idea, but a terrible idea. This creates a loop hole in your security which can be very easily exploited by a hacker. I would suggest writing your own custom widget for … Read more

Get term name without a foreach loop

What about using: echo get_the_term_list( $post->ID, ‘artist-genre’, ‘<li>’, ‘,</li><li>’, ‘</li>’ ); instead, to generate the HTML list? Or simply: the_terms( $post->ID, ‘artist-genre’, ‘<li>’, ‘,</li><li>’, ‘</li>’ ); that’s a wrapper for get_the_term_list(). Also notice that you’re missing the is_wp_error() check, in your code snippet, because wp_get_post_terms() can return the WP_Error object, for an unknown taxonomy. But … Read more

How to keep empty fields from appearing in php?

If you want to hide, for example, the_author_meta(‘linkedin’); if no data exists for that field, then you could just do the following <?php if(!empty(get_the_author_meta(‘linkedin’))) { ?> <a href=”https://wordpress.stackexchange.com/questions/187400/<?php the_author_meta(“linkedin’); ?>” target=”_blank”><i class=”fa fa-linkedin-square” title=”LinkedIn”></i></a> <?php } ?>` and then apply similar logic to other fields. If this is not what you were asking, then you … Read more