WP Full Calendar Changing the Event URL - php

I am using WP Full Calendar and Event Manager Plugin for Wordpress.
The calendar currently links to the single event url, however I want it to link to the #_BOOKINGSLINK placeholder (the admin page for management).
Is this possible to do?
I found code for the function file that removes the URL, but I am unsure of how to code the placeholder with PHP, as I am a beginner.
Is anyone able to assist me? Many thanks in advance.
Code That Removes URL from calendar:
function my_fc_filter( $events ){
foreach($events as $key => $event){
unset($events[$key]['url']);
}
return $events;
}
add_filter('wpfc_events','my_fc_filter');

Related

A very basic PHP modification I can't quite put into words for Google

I'm working on a very basic WordPress website for my dad and wanted to replace the theme's in-built need for an image logo and add a text logo.
The theme developer gave me this to add to functions.php:
add_filter('avf_logo_subtext', 'kriesi_logo_addition');
function kriesi_logo_addition($sub) {
$sub .= "<h5>WEBSITE TITLE</h5>";
return $sub;
}
function remove_title_attr(){
?>
Works just as expected.
However, I now want the logo to link back to the home page. I'm a complete newbie and just assumed I could put link tags within the h5 brackets, but this breaks the site. Where in the above can I put the link? The theme developer won't respond to my latest question.
Thanks in advance, and please remember we all have to start somewhere! I'm only young and this is not a paid project hence my lack of knowledge.
You can link back to home page using site_url() function in wordpress.
function kriesi_logo_addition($sub) {
$sub .= "<h5>WEBSITE TITLE</h5>";
return $sub;
}

how to automate the process of adding a link to comment in wordpress every time a comment is created

so we are making a wordpress site that automatically adds a link to a comment every time a comment is created. The theme we are using is html5 blank. I have written several lines of code into its function.php. however it is not working right now, here is what i wrote:
function bo_wrap_comment_text($content) {
$content = get_comment_text();
$texta = urlencode(get_comment_text());
$textb = "http://www.google.com/search?btnI&q=" + $texta;
return ''.$content.'';
}
add_filter('wp_insert_comment','bo_wrap_comment_text',1000);
a separate code(this one works) is tested here: http://phpfiddle.org and the code is:
<?php
$texta='i hate apple';
$textb=urlencode($texta);
$textc= "http://www.google.com/search?btnI&q=".$textb;
echo ''.$texta.'';
?>
the wordpress site is here. It is simply a static front page. the title you see there is the title of comment area. everything related with blog posts has been hidden using css. we have manually added links to several comments as prototyping. what we want is replace manual work with wordpress functions. I would really appreciate any help.
You need this hook instead to edit comment data:
http://codex.wordpress.org/Plugin_API/Filter_Reference/preprocess_comment

Yii2 Advanced Template Calendar Widget: Display events from database

I'm using yii2-fullcalendar widget and I used thiagotalma's post on github as a guide for the installation of the calendar widget. Below is the code that I've used to display the calendar on the page:
<?= \talma\widgets\FullCalendar::widget([
'googleCalendar' => true, // If the plugin displays a Google Calendar. Default false
'loading' => 'Carregando...', // Text for loading alert. Default 'Loading...'
'config' => [
// put your options and callbacks here
// see http://arshaw.com/fullcalendar/docs/
'lang' => 'en-ca', // optional, if empty get app language
],
]); ?>
and the above code displays the calendar on the web page. Now, I want to display the events from database but I don't have any idea how to do it. Can anyone help me regarding this matter? Thanks in advance.
You might want to look into my calendar view widget, looks like it's bang on. Takes data from your model and puts them into a responsive calendar.
I am the author btw. Should be simple enough if you read through the readme, it's step by step.

Wordpress is page str replace

I have page on wordpress site
http://upsourcemobileservices.com/solutions/
in footer.php I have added the following:
if(is_page('solutions')){
echo str_replace("The MVNi","The MVNi solution was created to ensure that wireless communications are available to the smaller Telco operators.","The MVNi");
}
but it is not changing the contents of the page.
To my knowledge, Syntax is correct str_replace(find,replace,string)
What am I doing wrong?
I also tried using jQuery
function replaceText(jQuery) {
$(".portfolio-thumbnail-content:nth-child(1)").replaceWith("<div class='portfolio-thumbnail-content'>The MVNi solution was created to ensure that wireless communications are available to the smaller Telco operators.</div>");
$(".portfolio-thumbnail-content:nth-child(2)").replaceWith("<div class='portfolio-thumbnail-content'>Primarily aimed at existing Telcos our MVNc solution integrates your existing platforms with ours through the use of APIs.</div>");
$(".portfolio-thumbnail-content:nth-child(3)").replaceWith("<div class='portfolio-thumbnail-content'>UMS turnkey solution is a complete MVNO in a box.</div>");
$(".portfolio-thumbnail-content:nth-child(4)").replaceWith("<div class='portfolio-thumbnail-content'>This solution allows you to select the products and services that you want and integrate them with your existing platforms.</div>");
}
$(document).ready(replaceText);
but can't seem to get that working either, here's a fiddle http://jsfiddle.net/vzy9R/3/
I used jQuery eq() selector to find elements containing class portfolio-thumbnail-content and then using .replaceWith() I was able to load my teaser content (excerpts) ending with complete sentences.
For example, the About page:
(function ($) {
$(".portfolio-thumbnail-content:eq(0)").replaceWith("<div class='portfolio-thumbail-content'>This is my new complete sentence teaser for Team.</div>");
$(".portfolio-thumbnail-content:eq(1)").replaceWith("<div class='portfolio-thumbail-content'>This is my new complete sentence teaser for Partners.</div>");
})(jQuery);
Then I had to figure out a way to implement those scripts into the body of those pages, so I wrote my own shortcodes and added them to functions.php
//[replaceTextAbout]
function replaceTextAbout_func( $atts ){
return "<script src='/javascript/custom/replaceText-About.js'></script>";
}
add_shortcode( 'replaceTextAbout', 'replaceTextAbout_func' );

how to filter "link to existing content" suggestion in wordpress?

How can i filter the link given in "link to existing content".
As in the above image. I just want WSP BANNER TO BE SHOWN.
where WSP BANNER & CALENDAR are custom post_type
Any help will be appreciable.
Currently there are no ready filters available for this purpose. A ticket has been posted for the request.Lets hope we get one soon.
Till then you can create your own filter.
Open includes/class-wp-editor.php and make folowing changes at line no 712
$pt_names = apply_filters('custom_insert_link_suggestion_filter',array_keys( $pts ));
we just added a new filter instead of getting all the public post types
Then in your theme add following code to filter the internal link custom post type
function my_filter_function($allowed_post_types)
{
if( condition chek)
{
return array('page','your custom post types');
}
}
add_filter('custom_insert_link_suggestion_filter','my_filter_function',10,1);
There is a plugin that could be helpful for you: B09 Link to Existing Content
It has a filter called "link_to_existing_content_post_types", that enables you to control which post types should be searched.
You can also use it together with this plugin, if you also want to have complete control over the search results: Search Everything.
Consider an example where my site is configured on wp.abc.com and I point my root domain www.abc.com to the new site. I need to update the URL's in General Setting. So when I update the URL, it is reflected in menu items etc. Will it be reflected in the content area links aslo?

Categories